Text Reflow

Reflow wrapped hard-wrapped prose to a target column width without breaking words.

  • Runs locally in your browser
  • No upload required

Try it

Paragraphs
2
Lines
3
Longest line
39 chars

Supported formats

Input
text, number
Output
number, text

Privacy

Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.

Processing
In your browser
Privacy level
Browser only

Reflowed 2 paragraph(s) to 24 columns; longest line is 24 characters.

How it works

  • Split the text on blank lines into paragraphs.
  • Flattened soft line breaks inside each paragraph, then greedily packed words into lines of at most the target width.
  • Re-joined paragraphs with a single blank line.
  • Hard paragraph breaks (one or more blank lines) are preserved; only single line breaks inside a paragraph are treated as soft wrapping.
  • A word longer than the target width is placed on its own line rather than split.

Methodology

  1. Split into paragraphs on runs of blank lines.
  2. Within each paragraph, collapse whitespace and greedily pack words into lines no longer than the width.
  3. Re-join paragraphs with a blank line and report the paragraph, line and longest-line counts.

Usage

  1. Paste the text to reflow.
  2. Set the target column width.
  3. Read or copy the reflowed text.

Examples

These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.

Two columns of hard-wrapped prose

jsonSelect to copy
{
  "text": "The quick brown fox\njumps over\nthe lazy dog.\n\nSecond paragraph here.",
  "width": 24
}

Preserve paragraphs

jsonSelect to copy
{
  "text": "First paragraph.\n\nSecond paragraph.",
  "width": 80
}

Narrow column

jsonSelect to copy
{
  "text": "one two three four five six",
  "width": 20
}

Limitations

Soft versus hard wraps

When an editor wraps long prose it usually inserts a real newline (a *hard* wrap). That is why text copied from a narrow window arrives with short, ragged lines. Reflowing replaces those soft wraps with space and re-wraps at a width you choose.

Blank lines are treated as intentional paragraph breaks and are kept. Because the tool is prose-oriented, apply it to paragraphs rather than to code, tables or lists.

Frequently asked questions

Will it change my Markdown?
It reflows the text as prose, so fenced code blocks, tables and list indentation can be altered. Use it on plain paragraphs, not on structured documents.
How does it treat single versus blank line breaks?
A single newline is treated as soft wrapping and removed; one or more blank lines mark a hard paragraph break and are preserved.

Sources

  1. Unicode Standard Annex #14: Line Breaking Algorithm — Unicode
  2. MDN Web Docs: text formatting — MDN