Plain-text email, commit messages and code comments are easiest to read when lines stay around 72 characters. The Text Wrapper breaks long lines at a width you choose, and works in reverse too, joining hard-wrapped lines back into flowing paragraphs. Existing paragraph breaks are kept, and leading indentation carries onto every wrapped line.
How to use it
- Paste your text.
- Choose wrapping or unwrapping.
- Set the maximum line width, usually 72 or 80.
- Tick the split-long-words option if URLs or long words would otherwise overflow, then copy the result.
When it helps
- Formatting plain-text emails so they look right in every client.
- Writing commit messages that meet a team's line limit.
- Reflowing text copied from a narrow column.
- Preparing text for a terminal or fixed-width display.
Good to know
- Seventy-two characters is a common choice because it leaves room for quoting replies.
- Blank lines stay put, so paragraphs don't merge.
- Only turn on word splitting if you must; breaking a URL makes it unclickable.
How wrapping decides where to break
The wrapper reads each line, splits it into words, and adds words to the current output line until the next word wouldn't fit within your chosen width. Then it starts a new line. Existing line breaks are respected, so a blank line between paragraphs stays blank, and indentation at the start of a line is repeated on each wrapped line.
Words longer than the width are left whole by default, because splitting a word or a link can make it unreadable or unclickable. If you tick the option, long words are cut at the width instead.
Worked example: a commit message
Git convention suggests keeping the body of a commit message to about 72 characters per line. A paragraph typed as one long line becomes five or six tidy lines at width 72, ready to paste into your editor. The result's line count and longest-line figures confirm nothing is longer than the limit.
For plain-text email, 72 is also a safe choice. It leaves room for reply prefixes, so quoted text doesn't wrap awkwardly in the recipient's client.
Unwrapping, and when to use each
Unwrap does the opposite. It joins the lines inside each paragraph into one line, leaving blank lines between paragraphs. That's useful for text that was hard-wrapped by an email program and now needs to flow in a document.
Wrapping is for destinations that don't wrap by themselves, such as terminals and plain-text files. For anything displayed in a browser or word processor, leave lines long and let the software do the wrapping at the right width for each reader.
Questions
Will it break words in half?
Only if you allow it for words longer than the width. Otherwise lines break between words.
What does unwrap do?
It joins the lines inside each paragraph into one long line and keeps the blank lines between paragraphs.