# word-wrap

> The `word-wrap` CSS property allows long words to be broken and wrap onto the next line.

> **Deprecated.** Legacy alias kept for compatibility. Use `overflow-wrap` instead. Use instead: [overflow-wrap](https://wonderium.dev/css/overflow-wrap.md).

## What is the difference between word-wrap and overflow-wrap?

The legacy name of `overflow-wrap`, kept by browsers for compatibility. With 'break-word' it lets long words or URLs break to avoid overflow. New code should use `overflow-wrap` instead.

- Topic: Text Handling
- Type: property
- Browser support: Chrome 80+, Chrome Android 80+, Edge 80+, Firefox 72+, Firefox Android 79+, Safari 13.1+, Safari iOS 13.4+

## Example

Wrong:

```css
.comment {
  word-wrap: break-word;
}
```

Right:

```css
.comment {
  overflow-wrap: break-word;
}
```

`word-wrap` is a legacy alias; `overflow-wrap` is the standard name with the same 'break-word' behavior.

## Common mistakes

- Copying `word-wrap: break-word` from old snippets instead of the standard name.

## Key points

- New code uses `overflow-wrap`, with `word-wrap` only as an extra legacy line if at all.
- Long words are broken with 'break-word' or 'anywhere', not with `word-break: break-all`.

## Interview questions

### Does word-wrap still work?

Yes. Browsers keep `word-wrap` as an alias of `overflow-wrap` for compatibility, but it is not the standard name.

### Does word-wrap support the anywhere value?

As an alias it accepts the same values as `overflow-wrap`, but use `overflow-wrap: anywhere` to be clear.

## Related cards

- [overflow-wrap](https://wonderium.dev/css/overflow-wrap.md)
- [word-break](https://wonderium.dev/css/word-break.md)
- [hyphens](https://wonderium.dev/css/hyphens.md)

---

- Level: [CSS](https://wonderium.dev/css.md)
- HTML version: https://wonderium.dev/css/word-wrap
- Last updated: 2026-11-25
