Long lines break things. A diff reviewer scanning an 800-character line scrolls sideways instead of reading. A terminal set to 80 columns wraps unpredictably, splitting words mid-syllable. An email client re-flows prose that was already reflowed, doubling the paragraph breaks. Text Wrapper / Word Wrap Tool lets you set the exact column width you need and get clean output in one step, without opening a text editor or wrestling with a formatter config.
Two wrapping modes cover the full range of use cases. Word wrap respects word boundaries and never splits a word unless the break-long-words option is on. Hard wrap cuts at the column character count regardless of content, which is what code formatters and certain terminal tools require.
Worked Example: Wrapping a Release Note at 72 Characters
Click Load Sample to paste a three-sentence paragraph about a deployment pipeline. With the column width set to 72 and Word wrap active, the single long paragraph becomes four lines, each no wider than 72 characters. The stats bar reports 1 line in and 4 lines out, with Longest showing the character count of the widest output line.
- Switch to Hard wrap and the same text is cut at position 72 regardless of whether a word falls on the boundary. A word like
integration near the end of a line may be split into two fragments. This is the mode git logand most patch formats expect. - Click the 80 preset to jump the column width to 80 without typing. The six presets (40, 60, 72, 80, 100, 120) cover the most common terminal widths and style guides. The number field stays editable, so any value from 1 to 10,000 is valid.
- In word-wrap mode, tick Break words longer than the column width to handle URLs, hashes, and minified tokens that would otherwise overflow the target width as a single unbreakable token. Without it, a 120-character URL in a 72-column paragraph stays on one line rather than being cut mid-character.
The Algorithm Behind Word Wrap and Hard Wrap
- Word wrap splits the text on whitespace tokens, accumulates words into a line until the next word would push it past the column width, then starts a new line. Empty lines (paragraph breaks) are preserved exactly as they appear in the input.
- Hard wrap treats each input line independently and slices it into chunks of exactly N characters, joining them with newlines. It does not look at words at all — every Nth character is a break point whether it falls on a space or inside a word.
- Existing newlines in the input always produce a newline in the output. Word wrap treats a single newline as a paragraph separator, so
line one\nline two produces two wrapped paragraphs, not one merged line.
How Big the Output Gets: Input Ceiling and Width Cap
- Inputs over 100,000 characters are rejected before wrapping begins: Input is N characters — the limit is 100,000. The algorithm is O(n) but browser paint slows noticeably above that threshold.
- A column width below 1 shows Column width must be a whole number of at least 1. A width of 1 wraps every character onto its own line — technically valid and occasionally useful for vertical text layouts.
- A width above 10,000 shows Column width cannot exceed 10,000 characters. At that scale most inputs produce a single output line, making the tool a no-op, so the ceiling exists to catch accidental large values rather than to limit real use.
- All processing runs locally. No text is sent anywhere.