Skip to content
Jellykit

Word Wrap

Hard-wrap text at a column width of your choice, keeping indentation, or join wrapped lines back into paragraphs.

  • Runs on your device
Loading tool

About Word Wrap

Put real line breaks into a text so that no line runs past a chosen width: 72 columns for a commit message or plain-text email, 80 for a terminal, or whatever a form or a printer expects. Lines break at spaces, an indented paragraph stays indented on every line, and a word too long for the line (a web address, say) is left whole unless you ask for it to be split.

Unwrap does the reverse: it joins the lines of each paragraph back into one, so text copied from an email or a PDF reflows again. Blank lines between paragraphs and the lines of a bulleted or numbered list stay where they are.

How it works

  1. Each line is measured in visible characters, so an accented letter or an emoji counts as one column. A tab counts as four.
  2. A line longer than the width breaks at the last space that fits. The spaces at a break are dropped; spacing between words that stay together is kept, and so are lines that already fit.
  3. With indentation kept, every new line gets the same leading spaces or tabs as the line it came from, unless that indent alone would fill the line.
  4. Unwrap joins each run of non-blank lines with a single space, or with no space between Chinese or Japanese characters. A line that starts with a bullet or a number such as "1." begins a new line.

Questions

Why is one of my lines still longer than the width?

It holds a single word, often a web address, that is longer than the line on its own. It is kept whole so that it still works when copied, and the tool tells you how many lines that applies to. Turn on breaking long words to cut it into pieces.

Does wrapping change the line breaks I already have?

No. Existing line breaks, blank lines and the style of line ending (Windows or Unix) are kept. Wrapping only adds breaks inside lines that are too long.

What width should I use?

Git commit message bodies and plain-text email are usually wrapped at 72 columns; many style guides for code comments use 80. Any width from 1 to 1,000 columns works.

Will unwrapping merge my bulleted list into one line?

No. A line that starts with -, *, +, • or a number followed by a full stop or bracket starts a new line, so list items stay separate while their own wrapped lines are joined.

Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.