Text Wrap/Unwrap
Wrap text at a specified column width, or unwrap to remove hard line breaks.
Related Tools
About This Tool
Email clients and old text editors wrap text at 72 or 80 characters, which is great until you paste that text somewhere else and end up with a hard newline every line.
This tool toggles between wrapped and unwrapped text. Unwrap mode joins hard-line-broken paragraphs back into a single line, preserving paragraph breaks (double newlines). Wrap mode does the reverse — break a long line at a configurable column (72, 80, 100) at word boundaries.
Email signatures and quoted-reply text are detected and preserved separately. Code blocks (indented with 4 spaces or wrapped in triple backticks) keep their original line breaks since wrapping them would break syntax. Output is plain text — useful when round-tripping through email systems that mangle paragraph structure or when writing for a target environment with specific line-length conventions.
The wrap algorithm walks the text, accumulating words into a line buffer until adding the next word would exceed the column limit, then emits the line and starts fresh. Word boundaries are detected by whitespace; the algorithm doesn't break mid-word, which means some lines come up slightly under the limit if the next word is too long to fit. Unwrap does the reverse: join lines that are part of the same paragraph (single newline) into one line, while preserving paragraph breaks (double newlines) as paragraph separators in the output.
The pain this addresses: pasting code or text from terminals, emails, or documentation that has hard line breaks at 72 or 80 columns. Modern tools display reflowable text — wrap is automatic at the display width. Pasting hard-wrapped content into them produces ragged paragraphs where every line ends prematurely. The fix is unwrap: rejoin the broken lines into clean paragraphs that the display tool can rewrap appropriately.
Worked example: input is a paragraph hard-wrapped at column 70: ``` The quick brown fox jumps over the lazy dog. This sentence has been wrapped at a fixed width that doesn't match how it will be displayed in your messaging app, which would have its own ideas. ``` Unwrap output: ``` The quick brown fox jumps over the lazy dog. This sentence has been wrapped at a fixed width that doesn't match how it will be displayed in your messaging app, which would have its own ideas. ``` The paragraph is now one continuous line that the receiving app can wrap to its actual display width. Round-trip the same text through wrap-at-80 and you get hard wrapping at the new width, useful for piping to terminal tools that expect fixed-width input.
Where this can break: text with intentional line breaks. Poetry, addresses, code, lists with one item per line — all use hard newlines deliberately. Aggressive unwrap would mash these into single paragraphs, which is wrong. The heuristic detects code blocks (indented or fenced), email-style blockquotes (lines starting with >), and bulleted lists (- * +) and preserves their structure. For unusual structured text, the unwrap might still merge things you wanted kept separate. Eyeball the output before pasting it somewhere consequential.
The about text and FAQ on this page were drafted with AI assistance and reviewed by a member of the Coherence Daddy team before publishing. See our Content Policy for editorial standards.