Text Formatter

Clean up line breaks, blank lines, and paragraph formatting, or wrap text to a fixed width.

How to Use the Text Formatter

  1. Type or paste your text into the box.
  2. Click "Remove Blank Lines", "Trim Each Line", "Normalize Line Breaks", or "Add Line Numbers" — or enter a width and click "Wrap to Width".
  3. Click "Copy to Clipboard" to copy the formatted result.

What Each Button Does

ActionWhat changesTypical use
Remove Blank LinesDeletes every line that is empty or contains only spaces or tabs.Turning text copied from a PDF or web page into a compact list.
Trim Each LineRemoves spaces and tabs at the start and end of each line. Spaces between words are untouched.Cleaning indentation from code snippets or chat exports.
Normalize Line BreaksConverts Windows and old Mac line endings to a plain line feed, then reduces any run of two or more blank lines to a single blank line.Keeping paragraph breaks while removing large gaps.
Add Line NumbersPuts "1. ", "2. " and so on in front of every line, including blank ones.Numbering a list of questions, steps or names.
Wrap to WidthJoins all the text into one stream of words, then breaks it into lines no longer than the width you set.Plain-text emails, README files, SMS drafts or fixed-width printouts.

Worked Example: Wrapping to 20 Characters

Wrapping "The quick brown fox jumps over the lazy dog near the riverbank." at a width of 20 gives four lines: "The quick brown fox" (19 characters), "jumps over the lazy" (19), "dog near the" (12) and "riverbank." (10). Adding the next word to the third line would have made it 23 characters, so the tool started a new line instead.

Two points to remember. First, wrapping replaces all existing line breaks with spaces, so separate paragraphs become one block; wrap one paragraph at a time if you want to keep them apart. Second, a single word longer than the width, such as a long URL, is never split and will sit on its own line beyond the limit. Widths of 72 to 80 characters are traditional for plain-text email and code comments.

Combining Actions

Every button works on the text in the input box, not on the previous result. To apply several steps, copy the result, paste it back into the input box and click the next button.

A useful order for messy text is: Trim Each Line, then Remove Blank Lines, then Add Line Numbers. Trimming first makes sure lines containing only stray spaces are recognised as blank. To remove repeated entries as well, use the Remove Duplicate Lines tool before numbering.

Frequently Asked Questions

It converts Windows-style (\r\n) and old Mac-style (\r) line breaks to standard Unix-style (\n), and collapses two or more consecutive blank lines down to a single blank line.

This tool works at the line and paragraph level (blank lines, line breaks, wrapping, numbering), while a simple space-collapsing tool only affects spacing within a line.

It rebuilds the text word by word, starting a new line whenever adding the next word would exceed your chosen character width, so words are never split mid-word.

Before wrapping, all spaces, tabs and line breaks are reduced to single spaces so the words can be re-flowed evenly. Paragraph breaks are lost in the process. Wrap each paragraph separately and join them with a blank line.

Not in one click. Each button starts from the original input, so paste the result back into the input box before using the next action.
No ratings yet — be the first!
Rate this calculator:
Was this tool helpful?