Unwrap hard-wrapped text into flowing paragraphs

Paste text that was broken at a fixed width, such as an old email or a PDF copy, and get one flowing line per paragraph, with split words joined back together.

Live demo · real result from this tool

Result

Hard-wrapped text is common in old emails and PDFs, where each line was broken at a fixed width. Blank lines mark new paragraphs and are kept.

Processed on your device — nothing is uploaded.

How to use the Text Unwrapper

  1. Paste the hard-wrapped text into Your text.
  2. Keep Re-join words split with a hyphen at the line end ticked for text from PDFs and books, or untick it for text with many hyphenated compounds.
  3. Copy the result: one line per paragraph, with a single blank line between paragraphs.

What it does and when to use it

Hard-wrapped text has a line break every 60 to 80 characters, put there by an email program, a typewriter-style file or a PDF layout. Pasted into a word processor, a website form or a phone screen, it shows ragged half-empty lines and breaks in odd places. Unwrapping restores flowing paragraphs that the new app can wrap by itself.

Typical sources:

  • plain-text emails and mailing-list archives;
  • text copied from PDFs, scanned books and OCR output;
  • README and text files formatted for a terminal;
  • subtitles and transcripts with one short phrase per line.

The difference from Remove Line Breaks is the hyphen repair and the focus on paragraphs. Here, paragraphs are always kept and words split across lines can be put back together. To wrap the result again at a new width, use the Text Wrapper. If the text also carries stray zero-width characters from the PDF, run the Invisible Character Remover as well.

How it works

First, Windows and old Mac line endings are turned into plain line breaks. The text is then split into paragraphs wherever a blank line appears, and each paragraph is trimmed.

Inside each paragraph, if the hyphen option is on, the tool looks for a letter, a hyphen, a line break and a lowercase letter, and joins them without the hyphen. The hyphen stays when the hyphenated form appears elsewhere in the text or the first part is a compound prefix such as self- or well-; it goes when the joined form appears elsewhere. Next, every remaining line break, with any spaces or tabs around it, becomes a single space. Empty paragraphs are dropped, and the paragraphs are joined with one blank line between them. This all happens in your browser.

Worked examples

Email with a split word. Three lines of an old email, a blank line, then “A new para-” and “graph starts here.” The result is two paragraphs: “Hard-wrapped text from an old email breaks every line at a fixed width.” and “A new paragraph starts here.”

Hyphen option off. The same text with the box unticked keeps the hyphen and adds a space: A new para- graph starts here.

Extra blank lines. “one”, three blank lines, “two”, a line of spaces, “three” becomes three paragraphs separated by exactly one blank line each.

Limits and tips

  • Lists and poems are joined too, because each line break inside a paragraph looks like a wrap. Unwrap only the prose sections.
  • Indentation at the start of paragraphs is removed.

Frequently asked questions

How does it know where a paragraph ends?
A blank line marks a paragraph break. A line that holds only spaces or tabs also counts as blank. Every other line break is treated as a wrap and replaced by a space.
When is a hyphen at the end of a line removed?
When the option is ticked, a hyphen that has a letter before it and a lowercase letter at the start of the next line is removed and the two parts are joined, so "para-" + "graph" becomes "paragraph". If the next line starts with a capital, the hyphen and a space are kept.
Can it damage real hyphenated words?
It tries not to. The hyphen is kept when the same hyphenated word appears elsewhere in your text, or when the part before it is a prefix that forms compounds (self-, well-, all-, half-, quasi-, vice-), so "self-" followed by "service" becomes "self-service", while "self-" + "ish" still becomes "selfish". Other compounds split at their hyphen, such as "co-" + "op", lose the hyphen unless "co-op" appears elsewhere. Untick the option or check those spots by eye.
My text has no blank lines between paragraphs. What happens?
Everything is joined into one paragraph, because the tool has no other sign of where paragraphs end. Add blank lines at the paragraph ends first, then unwrap.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close