Text Wrapper
Text Tools · Added
A text box wraps lines for display and leaves the string untouched. Several formats need the line breaks to be real characters — git commit bodies, plain-text email, code comments, fixed-width output — and this puts them in at whatever column you choose, breaking at spaces so no word is cut.
How to use the text wrapper
- 1Paste your text and pick the column to wrap at.
- 2Add an indent if the text sits inside something — a comment block or a quoted reply.
- 3Check the longest-line figure; anything over the width is a single word that could not be broken.
- 4Switch to Unwrap to go the other way and join each paragraph back into one line.
Examples
A commit body
- Input
- A three-sentence paragraph, wrapped at 72
- Result
- Lines of at most 72 characters, so git log's four-space indent still fits inside 80
A word longer than the line
- Input
- A paragraph containing a 90-character URL, wrapped at 72
- Result
- One line overflows, and the tool says so rather than splitting the URL
Switching on word breaking splits it; leaving it off keeps the URL usable.
About the text wrapper
Soft and hard wrapping are different things
A textarea, a chat window and a word processor all wrap lines for display without touching the underlying text: resize the window and the wrapping changes. That is soft wrapping, and it is the right behaviour for anything that will be read on a screen of unknown width.
Hard wrapping puts newline characters into the data. Once done, it does not adapt — text hard-wrapped at 80 and then read in a 40-column window wraps twice and looks ragged. That is the cost, and it buys predictability: the output looks the same everywhere, which is why formats older than resizable windows still ask for it.
Where a hard wrap is still expected
Git commit messages, by strong convention: a short subject, a blank line, then a body wrapped at 72. Plain-text email, where RFC 5322 sets a hard limit at 998 characters and convention sets a much shorter one. Code comments, wherever the project has a column limit. Fixed-width reports and anything destined for a terminal.
The common thread is that the reader's display width is unknown but bounded, and the writer would rather choose the line breaks than let something else choose them badly.
Frequently asked questions
Why 72 columns rather than 80?
What happens to a word longer than the width?
Is unwrapping the exact opposite of wrapping?
Does it preserve the paragraph structure?
Related tools
Text Cleaner
Text Tools
Strip extra spaces, blank lines, line breaks, HTML tags, punctuation and smart quotes.
Character Counter
Text Tools
Count characters with and without spaces, with live limits for tweets, SEO tags and SMS.
Word Counter
Text Tools
Live word, sentence and paragraph counts with reading time and keyword density.