Word Wrap Tool – Reflow Text to Any Fixed Line Width
Plenty of places still count columns. A Git commit body is conventionally wrapped at 72, a plain-text email at 76 so quoting has room to grow, source files and terminals at 80, and a printed column at whatever the page allows. Paste a paragraph written in a soft-wrapping editor into any of them and you get one enormous line. This word wrap tool reflows text so that no output line exceeds the width you set, breaking only where a reader expects a break.
Six ways to reflow
Word wrap is the default: lines break at whitespace only, so no word is ever cut in half. Hard wrap cuts at exactly the width regardless of word boundaries, which is what you want for a hash, a Base64 blob or a fixed-record data format. Unwrap is the inverse operation — it joins the hard-wrapped lines of each paragraph back into one continuous line so the text is editable again. Hanging indent indents every line after the first, giving the bibliography and definition-list shape. Prefix wrap puts a marker such as > , // or # on every line and counts it inside the width. Per line wraps each input line on its own and never merges two lines together, which suits log files, CSV cells and subtitle blocks.
How the algorithm fills a line
The default layout is the classic greedy fill: keep adding words to the current line while they still fit, and start a new line the moment one does not. It is fast and predictable, but it leaves a ragged right edge, because a long word pushed to the next line can leave a big gap behind it. Switching on balanced layout instead runs a dynamic program that minimises the sum of squared trailing slack across the paragraph — the Knuth–Plass objective — so the lines come out visibly more even. Balanced layout costs quadratic time in the word count, so it stands down on very long paragraphs and says so.
Structure the tool tries to keep
With preserve paragraphs on, a paragraph ends at a blank line, at a change of quote depth, or at the start of a new list item, and text is never merged across one of those boundaries. With preserve indentationon, each paragraph’s leading whitespace and its >quote markers are repeated on the continuation lines, and a Markdown list item’s continuation lines are aligned under its text rather than under its bullet. Turning paragraph preservation off reflows the whole input as a single stream, which is occasionally what you want and usually not.
Measuring width honestly
“Eighty characters” means different things to different systems, so the measure is yours to choose. Characters counts grapheme clusters, so a flag or a skin-toned emoji counts as one and is never split down the middle. Code points counts Unicode code points, which is what most programming languages report as a string length. Display width counts terminal columns, giving East Asian wide and fullwidth characters two and combining marks zero — the setting to use when the target is a terminal. Tabs are expanded to spaces at your chosen tab size before anything is measured, so the width is the width you actually see.
Reading the results
A monospace column ruler sits above the output so the wrap column can be read straight off it, and a before/after pair shows how many lines the reflow produced. The line-length chart draws one bar per output line against a dashed limit line, so an unbreakable overflow is obvious at a glance, and the fill ratio meter reports how much of the available width the average line actually uses. The statistics table gives input characters, input and output line counts, longest and shortest lines, average line length, words, paragraphs and the longest single word — the number that tells you the narrowest safe width. Alongside it, the width is converted into ASCII, UTF-8 and UTF-16 bytes using the ratio measured from your own text, and into a printed width in inches and centimetres at a monospace point size you pick.
Exporting and privacy
The wrapped text copies to the clipboard or downloads as TXT, and the per-line breakdown — number, paragraph, width, slack, status and content — downloads as CSV. Output line endings can be written as LF, CRLF or CR for whichever platform the file is bound for. Everything runs in your browser, so nothing is transmitted and confidential drafts stay on your machine; your last input and settings are kept in local storage, and the share link carries the text only while it is short enough to fit in a URL.