Text cleaner
Tidy text copied from websites, Word, PDFs or chat apps. Pick what to remove and copy the clean result.
This free online text cleaner works in your browser. Everything runs in your browser. What you type is not sent anywhere. All inputs and calculations run locally on your device without server uploads; details on browser processing and storage are set out in the privacy policy.
What gets cleaned
Text copied from the web and from documents carries things you cannot see: non-breaking spaces, zero-width characters that break searches and code, soft hyphens, tabs and runs of blank lines. Each option removes one kind of clutter, and they are applied in a safe order, with HTML removed before spaces are tidied.
When each option helps
- Invisible characters: when a password, code or search does not match even though the text looks identical.
- Smart quotes: before pasting into code, CSV files or a terminal, which expect straight quotes.
- Strip HTML: when you have copied the source of a web page or an email.
- Non-ASCII: for old systems that only accept plain English letters. It turns “café” into “cafe”.
Worked example: Stripping smart quotes, zero-width spaces, and HTML tags from copied text
Suppose you copy a code snippet or command from a blog post or Word document that fails in your terminal because of hidden formatting:
<p>curl -X POST “https://api.example.com/v1/items” -H ‘Accept: application/json’</p>
- Why that command fails in Bash/PowerShell: It wraps the text in
<p>HTML tags, uses curly typographic quotes (“”and‘’) instead of straight ASCII quotes ("and'), contains an invisible Unicode zero-width space (U+200B) right after the closing quote, and has multiple spaces between flags. - After running Text Cleaner (Strip HTML, Straighten quotes, Remove hidden Unicode, Collapse extra spaces):
curl -X POST "https://api.example.com/v1/items" -H 'Accept: application/json'
Limits and what this tool cannot do
- Do not enable 'Collapse multiple spaces' on Python or YAML code: Collapsing spaces at the start of lines flattens indentation in whitespace-significant languages like Python and YAML; use Trim trailing spaces and Remove hidden characters instead.
- Stripping HTML tags removes
<script>/<style>markup tags, not their inner text: Tag stripping removes<...>angle-bracket tags to leave plain text.
Questions
Will it change my words?
Only in the ways you choose. Spelling and wording are never changed.
How do I find hidden characters?
Turn on Remove invisible characters. The count of removed characters tells you if there were any.
Is my text uploaded?
No. Everything runs in your browser. What you type is not sent anywhere.
What are 'zero-width spaces' and non-breaking spaces, and why do they break code?
A non-breaking space (U+00A0, from or Option+Space on Mac) looks identical to a normal ASCII space (U+0020), and a zero-width space (U+200B) is completely invisible—yet compilers, JSON parsers, and SQL engines reject them as illegal syntax characters.
Why do curly 'smart quotes' (“ ” ‘ ’) break JSON and shell commands?
Word processors and CMS editors automatically turn straight ASCII quotes (" 0x22 and ' 0x27) into typographic left/right quotes (U+201C, U+201D, U+2018, U+2019). Programming languages and JSON only recognize straight ASCII quotes.
Does Text Cleaner upload my document to a server?
No. All string replacements run in your browser tab's local memory.
Related converters and guides
- Remove line breaksJoin broken lines into paragraphs, or add breaks after sentences.
- Find and replaceReplace words or patterns throughout a text, with regex support.
- Case converterChange text to UPPERCASE, lowercase, Title Case, camelCase and more.
- Email and link extractorPull emails, URLs, phone numbers or hashtags out of any text.