Text · 52 tools · nothing uploads

Wrap or unwrap text

Wrap or unwrap text. Runs entirely on your device, nothing is uploaded.

Input

Options

live

Wrap or unwrap text reflows a pasted text to a fixed line width, 80 characters by default, or joins wrapped lines back into paragraphs when mode is set to unwrap. Wrapping breaks only on whitespace between words, never inside a word, so one long word still overruns the line. Paragraphs are found by blank lines and wrapped independently.

Questions

How does wrapping decide where to break a line?

Only on whitespace between words. It builds each output line by adding the next word as long as the line, plus a space, plus the word, stays within the width; once it would not fit, the line closes and a new one starts with that word.

What happens to a single word longer than the width?

It is not split. A word by itself always becomes its own line even if that line ends up wider than the configured width, since the wrapper never breaks inside a word.

How does unwrap work?

It splits the text on paragraph breaks, then within each paragraph joins every line back together with single spaces, trimming each line first and collapsing any doubled spaces. The width option is ignored in this mode.

What counts as a paragraph boundary?

A blank line. Wrapping and unwrapping both treat text separated by one or more blank lines as separate paragraphs and process each one independently.

What happens with an invalid width?

Anything that is not a whole number of 1 or more is refused with "width must be a whole number of 1 or more".

Related Text tools