# Soft Hyphen (U+00AD)

Copy the soft hyphen (&shy;, U+00AD), an invisible hint for where a long word may break. See how to use it in HTML, CSS and long URLs.

| Property | Value |
| --- | --- |
| Codepoint | `U+00AD` |
| Decimal | `173` |
| HTML entity | `&shy;` |
| CSS escape | `\00AD` |
| JavaScript escape | `\u00AD` |
| URL encoding | `%C2%AD` |
| UTF-8 hex | `C2 AD` |
| Unicode category | Format (Cf) |
| Unicode block | Latin-1 Supplement |

The soft hyphen (U+00AD) is an invisible character that marks where a word may break. If the word has to wrap across lines, the soft hyphen shows as a visible hyphen at that point. If the word fits on one line, it stays invisible.

In HTML it's `&shy;`. It helps control layout on responsive sites, especially in languages with long compound words like German, Finnish, and Dutch.

## How Soft Hyphen Works

Take a long word like "incomprehensibilities" on a narrow screen:

**Without soft hyphens:** The word overflows its container, unless CSS such as `overflow-wrap: anywhere` lets the browser break it at an arbitrary point.

**With soft hyphens:** `incom&shy;pre&shy;hen&shy;si&shy;bil&shy;i&shy;ties` tells the browser where it may break. The browser picks the best break point for the available space and shows a hyphen there. The other soft hyphens stay invisible.

## Common Uses

- **Long words on mobile.** Technical terms, German compound words, or URLs can overflow small screens. Soft hyphens mark where they may break.
- **German, Finnish, and Dutch compound words.** These languages routinely produce words 20-30+ characters long: `Donau&shy;dampf&shy;schiff&shy;fahrts&shy;gesellschaft` (Danube steamship company).
- **Long URLs and email addresses in text.** For a URL shown in body text (not as a hyperlink), soft hyphens let it wrap: `https://example.com/very/&shy;long/&shy;path/&shy;to/&shy;resource`.
- **Technical terminology.** Long terms in documentation or medical text: `electro&shy;encephalo&shy;graphy`, `anti&shy;dis&shy;establish&shy;ment&shy;arian&shy;ism`.
- **Print and PDF layout.** Publishing software uses soft hyphens to control where words break across lines.

## How to Type

| Platform | Method |
|----------|--------|
| Windows | Alt+0173 on the numeric keypad. |
| macOS | No standard keyboard shortcut. Use Character Viewer (Ctrl+Cmd+Space). |
| Linux | Ctrl+Shift+U, type `00AD`, press Enter. |
| HTML | `&shy;`, `&#173;`, or `&#x00AD;`. |
| JavaScript | `­` in strings. |
| CSS | `content: '\00AD';` (rarely useful). |
| Microsoft Word | Ctrl+Hyphen inserts a soft hyphen (called "optional hyphen" in Word). |
| LaTeX | `\-` inserts a soft hyphen. |
| InDesign | Ctrl+Shift+Hyphen (or Cmd+Shift+Hyphen on Mac). |

## CSS Alternatives to Manual Soft Hyphens

To hyphenate a whole site rather than specific words, use CSS:

### `hyphens: auto`
```css
p {
  hyphens: auto;
  -webkit-hyphens: auto;
}
```
The browser hyphenates words using its built-in dictionary. It needs a `lang` attribute on the HTML element. It handles common languages well but may miss technical terms.

### `overflow-wrap: break-word`
```css
p {
  overflow-wrap: break-word;
}
```
Lets the browser break any word at any point to prevent overflow, with no hyphen. Use it as a safety net when you can't add soft hyphens.

### `word-break: break-all`
```css
p {
  word-break: break-all;
}
```
Breaks words at any character. Useful for CJK text, too aggressive for Western languages.

### Combined approach
```css
p {
  hyphens: auto;
  overflow-wrap: break-word;
}
```
`hyphens: auto` handles normal text, and `overflow-wrap` catches words the dictionary doesn't know.

Manual `&shy;` is still best when you need exact break points, especially for technical terms automatic hyphenation gets wrong.

## Technical Details

- **Unicode category:** Cf (Format), not punctuation.
- **Width:** Zero when not breaking. Normal hyphen width when the break is used.
- **Copy-paste:** Soft hyphens survive copy-paste and stay invisible, which can break search and comparison (see Common Pitfalls below).

In JavaScript:
```js
// Detect soft hyphens
text.includes('­')

// Remove all soft hyphens (useful before text comparison)
text.replace(/­/g, '')

// Add soft hyphens to a word at every N characters (crude approach)
// For real hyphenation, use a library like Hyphenopoly
word.replace(/(.{5})/g, '$1­')
```

## Soft Hyphen vs Zero-Width Space for Word Breaking

| Feature | Soft Hyphen (U+00AD) | [Zero-Width Space](/characters/zero-width-space) (U+200B) |
|---------|---------------------|---------------------------|
| Shows hyphen at break? | Yes | No |
| Visible when not breaking? | No | No |
| Semantically correct for word breaks? | Yes | No (it's a word separator, not a break hint) |
| Effect on search? | May break search matching | May break search matching |
| HTML entity | `&shy;` | `&#8203;` |
| Best for | Natural word hyphenation | Breaking long strings without showing a hyphen |

## Decision Tree: Which Word-Breaking Method to Use

1. **Is this a web page?** Try `hyphens: auto` in CSS first. It covers most cases with no manual work.
2. **Does CSS hyphens miss your word?** For technical, brand-specific, or very long words, add `&shy;` at the syllable breaks.
3. **Should a hyphen show at the break?** If yes, use soft hyphen. If no, use [zero-width space](/characters/zero-width-space) (U+200B).
4. **Is this plain text, not HTML?** Use the actual Unicode soft hyphen character (U+00AD), not the HTML entity.
5. **Is this a URL, hash, or technical identifier?** Use zero-width space. URLs should not show hyphens at break points.

## Common Pitfalls

1. **Search and matching.** Depending on the search implementation, text with soft hyphens won't match the same text without them. Strip soft hyphens before comparing or searching.
2. **Copy-paste artifacts.** People who copy text from your page copy the soft hyphens too. Pasted somewhere that doesn't render them, like a search box, they can cause unexpected results.
3. **URL encoding.** Soft hyphens in URLs are encoded as `%C2%AD` in UTF-8, which some servers may not handle correctly.
4. **Inconsistent rendering.** All modern browsers handle soft hyphens, but some older email clients and PDF renderers show them as visible hyphens at all times, not just at break points.

## Frequently Asked Questions

### What does &shy; do in HTML?

&shy; inserts a soft hyphen, an invisible break point inside a word. The browser breaks the word there, showing a visible hyphen, only if the word doesn't fit on the current line. If the word fits, the soft hyphen stays invisible.

### When should I use soft hyphen vs zero-width space?

Use soft hyphen (&shy;) when you want a visible hyphen at the break point, like normal word hyphenation. Use zero-width space (U+200B) when you want the word to break without showing any hyphen.

### Does soft hyphen work in all browsers?

Yes. Soft hyphen (&shy;) works in all modern browsers, including Chrome, Firefox, Safari, and Edge. It is one of the oldest and most widely supported Unicode characters.

### How do I add soft hyphens to long words automatically?

Use CSS hyphens: auto for automatic browser hyphenation, or a JavaScript library like Hyphenopoly or hypher to insert soft hyphens at correct linguistic break points. For a few specific words, add &shy; by hand.

### Can soft hyphens cause problems?

Yes. Soft hyphens are real characters even when invisible, so searching for a word won't match text that contains them unless the search term includes them too. They can also cause problems in URLs and filenames.

## Related Characters

- [Zero-Width Space (U+200B)](https://invisiblecharacterviewer.com/characters/zero-width-space)
- [Word Joiner (U+2060)](https://invisiblecharacterviewer.com/characters/word-joiner)
- [Non-Breaking Space (U+00A0)](https://invisiblecharacterviewer.com/characters/non-breaking-space)
- [Zero-Width Non-Joiner (U+200C)](https://invisiblecharacterviewer.com/characters/zero-width-non-joiner)
- [Em Dash (U+2014)](https://invisiblecharacterviewer.com/characters/em-dash)
- [Byte Order Mark (U+FEFF)](https://invisiblecharacterviewer.com/characters/byte-order-mark)

---

Canonical URL: https://invisiblecharacterviewer.com/characters/soft-hyphen
Markdown URL: https://invisiblecharacterviewer.com/characters/soft-hyphen.md
Agent instructions: https://invisiblecharacterviewer.com/llms.txt
