Remove extra whitespace from text online
Text copied from a PDF, email, or website often carries extra spaces, tabs, and stray blank lines. Paste it here and this tool trims each line, collapses repeated spaces and tabs into one, and reduces long runs of blank lines down to a single paragraph break — entirely in your browser.
What gets cleaned
Each line is trimmed of leading and trailing spaces, runs of spaces and tabs inside a line collapse to a single space, and three or more consecutive blank lines reduce to one. That combination handles the usual damage from copying text out of a PDF, an email client, or a web page, where invisible padding and inconsistent spacing come along for the ride.
Paragraph breaks are preserved
A single blank line between paragraphs survives, because removing it would destroy the structure of the text. Only excessive runs are collapsed. This is the main difference between this tool and a blunt find-and-replace on whitespace, which typically flattens everything into one unreadable block and forces you to reinstate paragraph breaks by hand.
Not suitable for code
Indentation is meaningful in Python, YAML, and Makefiles, and helpful in every other language. Because this tool strips leading whitespace from every line, running code through it will break Python outright and make anything else unreadable. It is built for prose. For code formatting, use a language-specific formatter that understands the syntax.
Frequently asked questions
- Does this remove all blank lines?
- No, single blank lines between paragraphs are kept; only 3 or more consecutive blank lines are collapsed down to one, preserving paragraph structure.
- Does this affect indentation inside a line?
- Yes, multiple spaces or tabs within a line are collapsed to a single space — this tool isn't meant for preserving code indentation.
- Is my text sent anywhere?
- No, cleanup happens locally in your browser using JavaScript. Nothing is transmitted.
- Will this remove line breaks entirely?
- No. Line breaks are preserved; only excessive blank lines between them are reduced.
- Can I use this on code?
- No — it strips indentation, which breaks Python and makes other languages hard to read. Use a code formatter instead.