Logo

MonoCalc

/

Word Wrap Tool

Text
Paste or type the text to reflow, or drop a plain-text file onto the box. Up to 10,00,000 characters.

Samples:

0 characters0 words0 lines0 paragraphs0 B

Breaks lines only at whitespace, so no word is split. A word wider than the limit gets a line to itself unless you switch on break long words.

Columns per line, prefix and suffix included.
The slider spans 10 to 200 columns; the number box reaches 1000.

Presets:

Prepended to every line and counted inside the width — try > or // or #.
Appended to every line and counted inside the width — try a trailing backslash.
Spaces on the first line of each paragraph.
Spaces on every line except the first.
Tabs are expanded to this many columns before wrapping.
Decimal places used by the statistics.
Counts grapheme clusters, so a flag or a skin-toned emoji counts as one character.
Newline convention written between the output lines.
Only used to convert columns into a printed width.

Nothing wrapped yet.

Paste or type text to wrap

The reflowed text, the column ruler and the per-line statistics all appear here as you type.

About This Tool

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.

Why a line can still come out over the limit
A single word wider than the space left for it has nowhere to go. By default it is left intact on a line of its own, that line exceeds the width, and it is flagged as over limit in the chart and the per-line table. Switch on break long words to force-split it instead. With hyphen-aware breaking on, the cut is pulled back to just after an existing hyphen, dash or slash where one fits, and you can add a visible hyphen at each forced break — which costs one column of the width.

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.

Frequently Asked Questions

Is the Word Wrap Tool free?

Yes, Word Wrap Tool is totally free :)

Can I use the Word Wrap Tool offline?

Yes, you can install the webapp as PWA.

Is it safe to use Word Wrap Tool?

Yes, any data related to Word Wrap Tool only stored in your browser (if storage required). You can simply clear browser cache to clear all the stored data. We do not store any data on server.

How does the Word Wrap Tool work?

Your text is first normalised — line endings collapsed to a single convention and tabs expanded to spaces at the tab size you chose. It is then grouped into paragraphs and each paragraph is filled greedily: words are added to the current line while they still fit inside the width, and the moment one does not, a new line starts. The prefix, suffix and any indent are counted inside the width, so a finished line never exceeds the limit unless a single unbreakable word is wider than the space left for it.

What is the difference between word wrap and hard wrap?

Word wrap only breaks at whitespace, so no word is ever split in half — this is what you want for prose, commit messages and email. Hard wrap cuts at exactly the width regardless of where words fall, which is what you want for hashes, Base64 blobs and fixed-record data formats. Hard wrap still refuses to cut inside a grapheme cluster, so an emoji or an accented character is never corrupted.

What happens to a word that is longer than the wrap width?

By default it is left intact on a line of its own, so that line exceeds the limit and is flagged in the results as over limit. Switch on "Break long words" and the tool force-splits it instead. With hyphen-aware breaking on it prefers to cut just after an existing hyphen, dash or slash, and you can optionally add a visible hyphen at each forced break.

Can it undo wrapping that has already been applied?

Yes — the Unwrap mode joins the hard-wrapped lines of each paragraph back into one continuous line. A blank line, a change in quote depth, or the start of a new list item still ends a paragraph, so structure survives the round trip. It is the standard way to make a hard-wrapped text file editable again before reflowing it to a different width.

How are East Asian characters and emoji counted?

You choose the measure. "Characters" counts grapheme clusters, so a flag or a skin-toned emoji counts as one. "Code points" counts Unicode code points. "Display width" counts terminal columns, giving East Asian wide and fullwidth characters two and combining marks zero — this is the setting to use when the target is a terminal or a monospace print column. Grapheme segmentation relies on Intl.Segmenter; without it the tool falls back to code-point counting and says so.

Is my text uploaded anywhere?

No. Every calculation runs in your browser and nothing is transmitted, so the tool is safe for confidential drafts. Your last input and settings are kept in your own browser's local storage so they are still there when you come back, and the share link only carries the text when it is short enough to fit in a URL.