Skip to main content

Reference

Soft Hyphen (U+00AD)

CleanPastedText editorial · Updated

Text workbench

Try it on your text

Cleaning mode

Keeps smart quotes, dashes, and ellipses while cleaning hidden characters.

Try a real example

Each sample contains a problem you cannot see.

Original

Pasted text

0 chars · 0 words

Cleaned

Ready to copy

0 changes

Text stays in this browser

Same words · No AI rewriting · No content logging

What is a soft hyphen?

A soft hyphen is U+00AD, an invisible character that says "you may break the word here." If the line has room, nothing shows. If the word would overflow, the layout engine breaks the line at the soft hyphen and draws a hyphen at the end of the first line. The character is still inside the word in the underlying text either way.

CharacterCode pointVisible?Allows a line break?
Hyphen-minusU+002DAlwaysYes, after it
Soft hyphenU+00ADOnly at a line breakYes, at that point
Non-breaking hyphenU+2011AlwaysNo

Where do soft hyphens come from?

  • Web pages that use ­ or CSS/JS hyphenation helpers to control wrapping in narrow columns.
  • Word documents where someone pressed Ctrl+minus to insert an optional hyphen, or that were hyphenated automatically before being copied.
  • PDFs and ebooks. Text copied from justified, hyphenated layouts can bring the line-end hyphen or a soft hyphen along. See cleaning text copied from a PDF for what is and isn't recoverable.

What does it break?

Anything that treats the word as a sequence of characters: Ctrl+F searches, spell-checkers that flag a correctly spelled word, keyword counts, string equality in code, database lookups and URLs. Because it is invisible, the text gives no clue. The same failure pattern applies to the zero-width space and other members of the invisible characters family.

How to remove soft hyphens

Paste the text into the cleaner above. It deletes each U+00AD and lists the count in the report so you can confirm the change. Do it yourself with these:

WhereHow
JavaScripttext.replace(/\u00AD/g, "")
Pythontext.replace("\u00AD", "")
Excel=SUBSTITUTE(A1, UNICHAR(173), "")

More patterns for every invisible character are in the regex guide.

When should I keep soft hyphens?

Keep them in HTML or Word source you are still going to publish, where they do their job of improving line breaks. Remove them from anything that becomes data: search indexes, spreadsheets, code, slugs, or text you are comparing. Do not replace a soft hyphen with a visible hyphen unless you have checked that the word really was split.

Common questions

Frequently asked questions

What is a soft hyphen?

A soft hyphen is the Unicode character U+00AD, also written ­ in HTML. It is a format character that stays invisible inside a word and turns into a visible hyphen only when the line has to break at that exact spot. It is a hint to the layout engine, not a hyphen you type.

Why can't I search for a word that contains a soft hyphen?

The word looks whole, but the text contains an extra character between two of its letters. A plain search for the full word does not match because the character sequences differ. Some applications ignore soft hyphens when searching, others do not, which is why the same word can be found in one app and missed in another.

How do I remove soft hyphens from text?

Delete every U+00AD. In CleanPastedText the 'Invisible characters' rule removes them in every preset. In code use a global replace of the pattern \u00AD with an empty string. Do not replace it with a hyphen: that would add a visible hyphen to words that were never split.

Is a soft hyphen the same as a normal hyphen?

No. A normal hyphen-minus is U+002D and is always visible. A non-breaking hyphen is U+2011 and never allows a line break. A soft hyphen is U+00AD and is visible only at a line break. All three are different code points and will not match each other in a search.

How do I type a soft hyphen in Word?

In Microsoft Word, press Ctrl and the minus key to insert an optional hyphen, which Word treats as a soft hyphen: it appears only if the word needs to break at that point. On the web, write ­ in HTML. Most other editors have no dedicated key for it.

Continue reading

Related guides & tools