Skip to content
AZ Tools

Word Wrap — Reflow Text to a Column Width

Hard-wrap text to a fixed line width, breaking at word boundaries, in your browser.

Wrapped text

Lines: 2 · Longest: 39

How to use

  1. Paste or type your text into the input box.
  2. Set the line width and choose whether to break overly long words.
  3. Copy the wrapped text from the output box.

About this tool

Show

Paste text and hard-wrap it to a fixed line width. Each line is filled greedily with as many words as fit before a break is inserted at the next word boundary, which is the same approach a terminal or a plain-text mail client takes — good for commit message bodies at 72 columns, code comments, README paragraphs and anything that has to look right in a monospace font. Existing line breaks and blank lines are left alone, so paragraphs, lists and indented blocks keep their shape instead of being melted into one flow. A word longer than the width, such as a URL or a long identifier, is left to overhang by default; turn on hard breaking if the column limit matters more than the word. Everything runs locally — nothing is uploaded.

Frequently asked questions

Does it merge my existing lines?

No. Each input line is wrapped independently, so existing line breaks and blank lines are preserved. It only adds breaks, never removes them.

What happens to a word longer than the width?

By default it stays on its own line and overflows the width. Turn on 'Break long words' to split such words across lines at the width.

How is wrapping decided?

Words are packed greedily: each line takes as many whole words as fit within the width, then the next word starts a new line. Runs of spaces within a line collapse to single spaces.

Is my text sent anywhere?

No. Wrapping happens entirely in your browser; nothing is uploaded.

Why 72 columns for a git commit body?

Because git indents the body by four spaces when it shows a log, so 72 plus that indent sits inside the 80-column terminal width that everything else assumes. The subject line is conventionally shorter still, around 50, so it survives being listed in a narrow column.

Greedy wrapping leaves a very short last line. Can it balance them?

Not here. Greedy filling takes as many words as fit on each line, which is what a terminal and a plain-text mail client do, so the output matches how the text will actually be displayed. Balanced line lengths need a different algorithm and would no longer match those readers.

Related tools