Text tools

Text wrapper: wrap text to a set line width

This text wrapper breaks lines between words at a width you set, counted in characters. Paste plain text, pick a Line width, choose how to treat existing breaks and long words, then select Wrap text. It runs in your browser, and you can copy the result or save it as a .txt file.

Paste or type the text you want to reflow.

Wrap options

Width counts grapheme clusters (such as a letter with its accent or an emoji), not visual columns. Plain spaces and tabs collapse; indentation is removed. Output uses LF line endings. Keep whole allows long words to exceed the width; Split long words keeps grapheme clusters intact.

Choose your options, then wrap your text.

No wrapped text yet.

How to wrap text

To wrap text, paste it into Input text, set the options and select Wrap text. The result appears under Wrapped text, with the number of lines, the longest line and how many lines exceed your width.

  1. Paste text and set Line width

    Type or paste plain text into Input text. Line width starts at 72. Set a positive whole number to choose the length of each output line.

  2. Choose breaks and long words

    Under Existing breaks, choose Preserve paragraphs, Preserve each line or Join all lines. Under Long words, choose Keep whole or Split long words.

  3. Wrap and save the lines

    Select Wrap text. Check Wrapped text and its line counts, then select Copy text or Download .txt to use the result.

Editing the text or any option clears the old result, so select Wrap text again to see the new one. Cancel stops a run and keeps your input. Reset empties both boxes and sets the options back to 72, Preserve paragraphs and Keep whole.

What happens to line and paragraph breaks

Preserve paragraphs is the default. It treats a blank line as a paragraph break, joins the single breaks inside each paragraph with a space, then wraps each paragraph. So one, two, a blank line and three become one two, a blank line and three. A run of several blank lines keeps its count, and a line with only spaces or tabs counts as blank.

Preserve each line wraps every original line on its own and keeps all of its breaks, which suits lists and lines you have already broken by hand. Join all lines ignores every break, blank lines included, and wraps the whole text as one paragraph.

Windows CRLF, old Mac CR and the Unicode line and paragraph separators all become LF in the output. The tool never adds a final newline, so text that ends without a break still ends without one.

How the width is counted

Line width counts grapheme clusters, the units a reader sees as one character. A letter with a combining accent, an emoji with a skin tone and the space between two words each count as one. At width 20, the sentence The quick brown fox jumps over the lazy dog. becomes three lines: The quick brown fox, jumps over the lazy and dog. The first two lines are 19 characters long.

The count is not a pixel or screen-column measure. Wide characters, such as many emoji and Chinese, Japanese or Korean characters, can take more room on screen than a Latin letter, so their lines can look longer at the same count. The Wrapped text box does not wrap on screen; it scrolls sideways, so each line you see ends where the tool put a break.

Limits

This tool is for prose in plain text. It turns each run of spaces and tabs into one space and removes spaces and tabs at the start and end of each wrapped block, so indentation, code, Markdown lists and aligned columns lose their layout. Other characters stay as they are, including nonbreaking spaces, which keep two words together on one line.

A word here is any text between spaces or tabs. The tool does not hyphenate, look up dictionary words or find word breaks in scripts written without spaces, such as Chinese or Thai; choose Split long words to keep those lines within the width.

There is no set text-size limit; your browser's memory is the limit. The tool needs a current browser with JavaScript, Web Workers and Intl.Segmenter. Download .txt saves UTF-8 text with LF line endings and no byte order mark.

Questions

What is text wrap used for?

Text wrap keeps lines short in places that show plain text line by line, such as a plain-text email, a README file or a commit message. This tool writes the breaks into the text itself, so the short lines stay the same wherever you paste or save the result. Pick the width that the place you paste into expects.

Is this a hard wrap or a soft wrap?

It is a hard wrap. A soft wrap only changes how an editor shows a long line on screen, and the file still holds one line. This tool inserts real LF line-break characters, so the wrapped text keeps its short lines in any editor, email or file. Use Preserve each line to keep breaks you typed yourself.

What is a word wrap example?

At width 10, The quick brown fox jumps over the lazy dog. becomes five lines: The quick, brown fox, jumps over, the lazy and dog. Each break falls at the last space that fits, so no word is cut. The line jumps over is exactly 10 characters long, because the space between the words counts as one.

Can a word be longer than the line width?

With Keep whole, yes: a word or link longer than the width goes on its own line, and the result counts how many lines exceed your width. Split long words cuts such a word every width characters, with no hyphen added. It cuts only between grapheme clusters, so an emoji or an accented letter is never split in two.

Why does the result say no changes?

The tool compares the result with your input. When every line already fits and no breaks, spaces or tabs need to change, the status reads Wrap complete. No changes: output matches your input. Input with only spaces and tabs gives an empty result, and the status says that too, so an empty box is never a silent failure.