Wrap text at a set width
Set the maximum characters per line and any word that does not fit moves to the next line.
Loading the tool…
Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.
How to use it
- Enter text, maximum characters per line and cut words longer than the width.
- The result appears straight away and updates as you edit.
- Copy the result, or copy a link that keeps the same values to share it.
How it is calculated
Greedy wrapping: words are added to the line while its length plus a space and the next word stays within the width, otherwise a new line starts. A word longer than the width is cut into width-sized pieces when that option is on.
Example
Inputs: Maximum characters per line = 30, Cut words longer than the width = yes. Result: Result: The quick brown fox jumps over the lazy dog and keeps running across the field.; Lines: 3; Longest line: 30 characters.
The quick brown fox jumps over the lazy dog and keeps running across the field.
The quick brown fox jumps over the lazy dog and keeps running across the field.
Limits and caveats
- Length counts characters, not visual width, so wide characters and emojis may look longer.
- Runs of spaces and leading indentation are reduced to single spaces or dropped.
Questions about this tool
Are the original line breaks kept?
Yes. Each original line is wrapped on its own and blank lines between paragraphs stay.
What width should I use?
Widths of 72 or 80 characters are common for plain text email and code. Narrower widths suit small screens.
Are words split in the middle?
No, unless a single word is longer than the width and the cut option is on.
