Text Cleaner
Clean, format and tidy up messy text instantly — right in your browser.
About the Text Cleaner
What is the Text Cleaner?
Text picked up from a PDF, an email, a website, or a spreadsheet almost never arrives clean. It comes with double spaces, stray tabs, empty lines, curly quotes that break code, leftover HTML tags, and a dozen other small annoyances. This tool fixes all of that in one place. You paste the messy text in, flip a few switches, and a tidied version appears next to it — no installs, no sign-up.
It does more than trim whitespace. You can strip out HTML, drop punctuation or numbers, flatten accented letters to plain ASCII, turn smart quotes and em dashes into the plain versions, remove duplicate lines, sort lines alphabetically, change the letter case, and encode or decode HTML entities. Everything updates live as you type or toggle, and because it all runs in your browser, the text you paste never touches a server.
How to Use This Tool
- Paste your text. Drop it into the top box, or hit Sample text to see a deliberately messy example to play with.
- Pick your options. Toggle the whitespace and removal switches, and use the dropdowns to change case, sort lines, or handle line breaks. The cleaned result updates the moment you change anything.
- Watch the counts. Each box shows a live character, word, and line count, so you can see exactly how much the cleanup trimmed.
- Take the result. Copy it to your clipboard, download it as a
.txtfile, or press Use as input to feed the cleaned text back through for another pass.
Common Use Cases
A quick cleanup saves a surprising amount of fiddly manual editing. People reach for this tool to:
- Fix text copied from PDFs: PDFs love to scatter line breaks and double spaces mid-sentence. Join the lines and collapse the spaces and it reads normally again.
- Tidy content before pasting into a CMS: Strip the HTML and smart quotes that sneak in from Word or Google Docs so your post starts from clean, plain text.
- De-duplicate and sort lists: Paste a list of emails, tags, or keywords, remove the repeats, and sort them alphabetically in one go.
- Prepare data for import: Trim every line, drop blank rows, and flatten accents so a CSV or database import doesn't choke on stray characters.
- Normalize text for comparison: Lowercasing everything and stripping punctuation makes two blocks of text far easier to diff or search.
- Escape text for HTML: Encode
<,>, and&into entities so a snippet displays as literal text on a page instead of rendering.
Working with code or markup instead? Try our HTML Viewer or browse the full set of free developer tools.
Frequently Asked Questions
Is my text uploaded anywhere?
No. Every operation runs locally in your browser with JavaScript. Nothing you paste is sent to our servers, stored, or logged, and the tool keeps working even if you lose your connection after the page loads. That makes it safe for sensitive or internal text.
What's the difference between "Trim each line" and "Trim whole text"?
"Trim each line" removes the spaces and tabs at the start and end of every line, which is great for indented or padded text. "Trim whole text" only removes whitespace from the very beginning and very end of the entire block, leaving the lines in between untouched.
How does removing duplicate lines work?
It keeps the first time a line appears and drops any later line that is exactly the same, preserving the original order otherwise. Lines that differ by even a single space or a capital letter count as different, so pair it with "Trim each line" or a case change if you want a looser match.
What does "Smart quotes & dashes → plain" do?
Word processors auto-replace straight quotes with curly ones (“ ” ‘ ’), and hyphens with en and em dashes (– —). Those characters often break code, URLs, or older systems. This option swaps them back to plain ASCII quotes, hyphens, and three dots for an ellipsis.
What's the difference between encoding and decoding HTML entities?
Encoding turns special characters into their safe HTML form — < becomes < — so they show up as literal text on a web page instead of being treated as markup. Decoding does the reverse, turning < back into <. Use encode when displaying code on a page, and decode when you've pulled already-escaped text out of HTML.
Will it remove accented or non-English characters?
Only if you ask it to. "Accents" converts letters like é, ñ, and ü to their plain a-z equivalents while keeping the letter. "Non-ASCII characters" is more aggressive and strips anything outside the standard ASCII range, including emoji and most non-Latin scripts, so use that one with care.
Is there a limit on how much text I can clean?
There's no hard cap. Because the work happens in your browser, very large documents (think hundreds of thousands of lines) depend on your device's memory, but everyday paragraphs, articles, and lists are handled instantly.