Free Tool

Whitespace Trimmer

Clean up text pasted from PDFs, emails or chat apps by stripping extra spaces, tabs and blank lines — the tool this whole site is named after.

Copied!
Characters removed0

How to use the whitespace trimmer

Paste your text, choose which cleanup rules you want applied, then click "Trim whitespace." This is especially useful for text copied out of a PDF or a chat app, where invisible double spaces and stray line breaks tend to pile up and cause problems when you paste that text somewhere else, like a CMS or code editor.

Common uses

Cleaning up pasted PDF text

PDFs frequently insert odd spacing and line breaks mid-sentence when text is copied out. This tool collapses that back into normal, readable paragraphs.

Preparing text for code or config files

Trailing whitespace can break YAML, cause noisy git diffs, or fail lint rules. Strip it before pasting.

Fixing text pasted from AI chat tools

Responses copied from chat interfaces sometimes carry extra blank lines and inconsistent spacing that this tool normalizes in one pass.

Cleaning CSV or spreadsheet exports

Remove stray tabs and leading/trailing spaces from exported data before reimporting it elsewhere.

Frequently asked questions

What's the difference between the four options?

"Collapse multiple spaces" turns runs of 2+ spaces into a single space anywhere in a line. "Trim line edges" removes spaces at the very start and end of each line. "Remove blank lines" deletes entirely empty lines. "Tabs to spaces" replaces tab characters with a single space so indentation doesn't cause misalignment.

Will this change my paragraph breaks?

No, unless you enable "Remove blank lines." By default, paragraph breaks (blank lines between paragraphs) are preserved.

Does it fix non-breaking spaces (from Word or web pages)?

Yes, non-breaking space characters are normalized to regular spaces before the other rules are applied.

More text tools