Text Wrap Tool
Hard wrap text at a chosen column width with greedy or balanced line breaking, preserve indentation and paragraphs, and unwrap already wrapped text back into single paragraphs.
Last reviewed by the Radiatus Cloud team
Need this done properly for your business?
Radiatus delivers secure cloud, DevOps & compliance engineering.
Why hard wrapping still matters
Most modern displays wrap text automatically, so hard line breaks inside a paragraph feel obsolete. They are not. Git commit messages conventionally wrap the body at 72 columns so that git log, which indents by four spaces, stays inside 80. Plain text email, README files read in a terminal, code comments, changelogs, patch descriptions and configuration file comments all live in fixed width contexts where a soft wrapped paragraph becomes one enormous line.
Greedy and balanced wrapping differ
The greedy algorithm fills each line as far as it can before breaking, which is what almost every tool does. It is fast and produces a ragged final line that can be a single short word. The balanced approach minimises the total squared slack across all lines, the same principle behind Knuth and Plass line breaking in TeX, which produces lines of more even length at the cost of a slightly narrower average. For a two line paragraph the difference is obvious and for a long one it is subtle.
Unwrapping is the harder direction
Joining hard wrapped lines back into paragraphs requires deciding which line breaks were inserted by a wrapper and which were meant by the author. The signals are indentation changes, blank lines, lines that are much shorter than the wrap width, and lines that begin with list markers or punctuation. Getting it wrong destroys the structure of a document, which is why the unwrap here preserves blank line separated paragraphs, indented blocks and list items rather than joining everything.
Related tools
- Emoji Picker & Copier — Browse, search, and copy emojis by category. Collect multiple emojis and copy them all at once. Recently used emojis saved locally.
- Text to Speech Player — Convert text to natural speech using the Web Speech API. Adjustable voice, speed, pitch, and volume with playback controls.
- Speech to Text Transcriber — Transcribe speech to text using your microphone. Supports multiple languages with continuous listening, copy, and download features.
- Instagram Caption Generator — Generate Instagram caption ideas from a topic, tone, and optional CTA. Fast, template-based suggestions.
Frequently Asked Questions
What column width should I use?
72 for git commit message bodies, so the four space indent that git log adds keeps lines inside 80. 80 for code comments and README files, 79 for Python under PEP 8, and 72 for plain text email, which is a convention going back to quoted replies adding characters at the start of each line.
What is the difference between greedy and balanced wrapping?
Greedy fills each line as far as possible before breaking, which is what most tools do and can leave a single word on the last line. Balanced minimises the variation in line length across the paragraph, producing a more even block at the cost of slightly shorter lines.
Does wrapping break long words or URLs?
Only if you ask it to. By default a word longer than the wrap width is placed on its own line and allowed to overflow, because breaking a URL makes it unusable. Forced breaking is available for cases where nothing may exceed the width.
How does unwrapping know which breaks to remove?
It uses blank lines, indentation changes, list markers and unusually short lines as paragraph boundaries, and joins only lines that appear to be continuations. Any heuristic gets some cases wrong, so check the result on structured documents.
Why 72 columns for git commits?
Because git log indents the message body by four spaces, and a 72 column body plus that indent fits inside the 80 column terminal that the convention assumes. The subject line convention of 50 characters comes from the width available in tools that show subject and metadata on one line.
Privacy & Security
Everything runs in your browser; nothing is uploaded.
How to Use
Paste text, choose a column width, and wrap or unwrap it.
Disclaimer: This tool is provided "as is" without warranty of any kind. Results are for educational and utility purposes.
Related Tools
Emoji Picker & Copier
TextBrowse, search, and copy emojis by category. Collect multiple emojis and copy them all at once. Recently used emojis saved locally.
Text to Speech Player
TextConvert text to natural speech using the Web Speech API. Adjustable voice, speed, pitch, and volume with playback controls.
Speech to Text Transcriber
TextTranscribe speech to text using your microphone. Supports multiple languages with continuous listening, copy, and download features.