Text Wrapper

Hard-wrap text at a width you choose without cutting words in half, or unwrap broken lines back into paragraphs. For email, commit messages and plain text.

Some places still want lines of a fixed length. Plain-text email is traditionally wrapped at 72 characters so quoted replies fit. Git commit message bodies are conventionally kept to 72. Code comments follow whatever the project’s linter says, often 80 or 100. README files, terminal output and old-school Usenet-style posts all expect the text to arrive already wrapped.

Paste your text, set the width, and each line is broken at the nearest space so that no word is cut in half.

How the wrapping works

The tool reads each line, splits it into words, and fills the line up to your width, starting a new line when the next word would not fit. A line that is already short is left as it is, aside from the spacing, and blank lines between paragraphs are always kept.

Two things follow from that. First, it wraps each existing line on its own. It does not reflow a paragraph in which you have manual line breaks, so a block that has been wrapped at 60 will not tidy itself up at 80. For that, switch to unwrap first, then wrap again. Second, runs of spaces inside a line collapse into one, because the line is rebuilt from words.

A very long word, such as a URL, will not fit on any line. By default the tool splits it at the width, which keeps the result inside the limit but breaks the link. Untick that option if you would rather leave long words whole and let those lines overshoot.

Unwrapping

The other mode joins the lines inside each paragraph into a single line, keeping blank lines between paragraphs. Use it on text that was hard-wrapped by an email client or a terminal and now looks ragged in a place that wraps on its own, like a web form or a document. If the blank-line structure is missing and you just want everything on one line, remove line breaks offers more options, including keeping paragraphs.

Which width

Seventy-two is the safe number for email and commit messages because it leaves room for quote markers. Eighty matches the old terminal width and is still the default in many editors. One hundred or one hundred twenty suits modern code. For a poster or a caption, pick the width of the space rather than a convention.

If you only need to trim text to a certain total length rather than wrap it, use the text truncator. To add numbers down the side of wrapped text, add line numbers. And after wrapping, a quick pass through the word counter confirms nothing was lost.

Frequently asked questions

Why did my already wrapped paragraph not re-wrap?

Each existing line is wrapped on its own, so lines that are already short stay short. Unwrap the paragraph first to join it into one long line, then wrap it at the width you want.

It broke my URL. How do I stop that?

Untick "Split words longer than the width". Long words are then kept whole, and the line they sit on goes over the limit.

Are blank lines between paragraphs kept?

Yes, in both wrap and unwrap mode. Paragraph breaks stay where they are.