Text Formatter

Tidy spacing, blank lines and indentation.

How to use Text Formatter

  1. 1Paste the messy text into the box
  2. 2The cleaned version appears immediately below
  3. 3Runs of spaces and tabs collapse to a single space
  4. 4Every line is trimmed and empty lines are dropped
  5. 5Copy the tidied text

What Text Formatter does

Text copied out of a PDF, a web page or an email arrives carrying formatting that was never meant to survive the journey. PDFs pad with spaces to position words on a page, web pages carry indentation from their source, and quoted email replies accumulate leading characters and blank lines with each round.

None of that is visible as anything but a mess once the text lands somewhere else. The fix is mechanical and consists of exactly three operations, applied line by line: collapse runs of horizontal whitespace, trim the ends, and drop lines that are then empty. Knowing precisely which three matters, because it tells you what this will not fix.

When to use it

Text copied out of a PDF
PDFs position words with spacing rather than storing sentences, so pasted text arrives padded with runs of spaces in the middle of lines.
Content pasted from a web page
HTML source indentation comes across as leading whitespace on every line, and empty block elements become stray blank lines.
Quoted email threads
Each reply adds indentation and blank lines. After several rounds the text is more whitespace than content.
Preparing a list for de-duplication
Invisible whitespace differences are the usual reason two identical-looking lines are not recognised as duplicates. Normalising first makes the comparison work.

Text Formatter settings explained

Collapse spaces and tabs
Any run of spaces or tabs inside a line becomes a single space. This is the operation that fixes PDF paste, where words are separated by however many spaces the layout needed.
Trim each line
Whitespace at the start and end of every line is removed. Leading indentation from HTML source and trailing spaces from wrapped text both disappear.
Remove empty lines
Lines with nothing left after trimming are dropped entirely. This collapses the gaps that accumulate in quoted emails and pasted web content.
Line breaks are kept
Real line breaks survive — this tidies within and around lines but never joins them. A paragraph broken across five lines by a PDF stays five lines.

What is fixed and what is not

The three operations applied, and the common problems they do not address.
ProblemFixed?What to do instead
Runs of spaces inside a lineYes—
Leading or trailing whitespaceYes—
Blank linesYes—
Paragraph broken across many linesNoJoin the lines by hand
Curly quotes and dashesNoFind and replace
Hyphens splitting words at line endsNoFind and replace

Limits and what to expect

  • Line breaks are never removed, so a paragraph split across lines by a PDF stays split.
  • Only spaces and tabs are collapsed; other invisible characters such as non-breaking spaces are left in place.
  • Punctuation is untouched — curly quotes, em dashes and ellipses pasted from elsewhere survive unchanged.
  • Words hyphenated across a line break in the source are not rejoined.
  • Text is not saved; reloading the tab clears the box.

Troubleshooting

My paragraph is still broken across several lines
That is deliberate — line breaks are preserved, because removing them would destroy genuine lists and addresses. Joining a paragraph back together needs a find-and-replace in an editor, since only you know which breaks were real.
Some spaces did not collapse
They are probably non-breaking spaces, which look identical but are a different character. Copying from a web page is the usual source. Find and replace them with ordinary spaces first, then format.
Words are split with hyphens
The PDF hyphenated them at the end of a line and the hyphen came across as a real character. Nothing can safely rejoin those automatically, because a genuine hyphen in "well-known" looks exactly the same.
I wanted the blank lines kept between paragraphs
Empty lines are always removed. If paragraph separation matters, format the text and then reinsert the breaks where you want them — usually far fewer than the original had.

Your files and your privacy

Formatting runs in your browser as you type, with no request to a server and nothing stored. The tool works offline. Since the text being cleaned is generally something copied out of a document that was not meant to be shared in the first place, keeping it local is the sensible default.

What to use next

FAQ

Why is text copied from a PDF so messy?

A PDF does not store sentences, it stores positioned glyphs. Extracting text reconstructs a plausible reading order and pads with spaces where the layout had gaps, so what arrives is words separated by however much space the page needed rather than by single spaces.

Will it join my broken paragraph back together?

No. Line breaks are deliberately preserved, because removing them would ruin lists, addresses and poetry along with the paragraphs. Only you can tell which breaks were meaningful, so rejoining is left to a find-and-replace in an editor.

What exactly does it change?

Three things, applied per line: runs of spaces and tabs collapse to one space, leading and trailing whitespace is removed, and lines left empty are dropped. Nothing else is touched — punctuation, capitalisation and line breaks all survive.

Why are some spaces still doubled?

They are almost certainly non-breaking spaces, a different character that looks identical. They come from web pages and word processors. Replace them with ordinary spaces first and the collapse will then work.

Does it remove blank lines between paragraphs?

Yes, all empty lines are removed. If you want paragraph separation, add it back after formatting — you will usually want far fewer breaks than the pasted text contained.

Is my text uploaded?

No. The formatting happens in your browser with no network request, and nothing persists after you close the tab.