Text Cleaner
Convert case, strip extra spaces, remove duplicate lines, and sort text — all in one place.
Text Cleaner — Fix Messy, Copied, and Formatted Text
Text copied from PDFs, web pages, Word documents, and emails carries invisible baggage — HTML tags, extra line breaks, inconsistent spacing, special characters, smart quotes that break code, and formatting artifacts from the source application. Before you can use that text reliably in another context, it needs cleaning. This tool applies a configurable set of cleaning operations so you can get exactly the output you need.
What can it clean?
Remove HTML tags: Text copied from websites sometimes brings along the underlying HTML markup. A browser might strip it during paste, but many tools don't. This option removes anything inside angle brackets, leaving just the visible text.
Remove extra whitespace: Collapses multiple consecutive spaces into one and removes leading/trailing spaces from each line. Text from PDFs is notorious for this kind of irregular spacing.
Remove blank lines: Strips empty lines from the text. Useful when copied content has double or triple spacing between paragraphs that you want to eliminate.
Remove line breaks: Joins all lines into a single continuous paragraph. Useful when text from a PDF has hard line breaks at the end of each line (because the PDF was created from a scanned or fixed-width source) and you need it as flowing prose.
Remove duplicate lines: Keeps only the first occurrence of each line, removing subsequent duplicates. Useful for cleaning up lists and data exports.
Fix smart quotes: Converts "curly" or "smart" quotation marks and apostrophes (the angled ones used in Word and many design tools) to straight ASCII quotes. Essential when preparing text for code, CSV, or any system that doesn't handle typographic quotes correctly.
Remove special characters: Strips non-ASCII characters, control characters, and other symbols that might cause issues in databases, code, or plain text systems.
Convert line endings: Standardises line endings between Windows (CRLF), Unix/Mac (LF), and old Mac format (CR). This prevents invisible characters from causing problems in scripts and version control systems.
Common use cases
Cleaning PDF extractions: PDFs converted to text using copy-paste or a PDF reader often produce text with hard line breaks at every visual line, inconsistent spacing, and sometimes garbled characters where the PDF encoding doesn't map cleanly to Unicode. Apply "remove extra whitespace", "remove line breaks", and "fix smart quotes" together to get clean prose.
Preparing web copy for import: Blog content or product descriptions copied from a CMS or web page often includes leftover HTML tags. Remove them before importing into a different system.
Cleaning data for spreadsheets: Values pasted from websites or documents frequently have leading spaces, trailing spaces, or invisible characters that cause lookup functions (VLOOKUP, INDEX/MATCH) to fail silently. Run the data through this cleaner before pasting into the spreadsheet.
Fixing text for programming: Smart quotes break string literals in code. If you're copying a code snippet from a blog post, tutorial, or documentation and it doesn't run, convert the quotes first.
Processing government and official document text: In India, text extracted from government PDFs (ration cards, land records, official notices) is often particularly messy due to the varied PDF creation software used across departments. This cleaner handles the most common artifacts.
Preparing email templates: Text copied from Word documents into an email or HTML template often brings invisible formatting characters that cause inconsistent rendering across email clients. Clean it before using it in a template.
How to use it
Paste your messy text into the input area on the left. Tick the operations you want to apply — you can combine multiple cleaning options at once. The cleaned output appears on the right in real time. When you're satisfied, copy the cleaned text. Your original input stays in the left panel so you can adjust options without re-pasting.
Tips
Apply operations in the right order conceptually — for example, it makes sense to remove HTML tags before fixing whitespace, since tag removal can create extra spaces. The tool handles this internally, but thinking through the sequence helps you decide which options to enable.
"Remove line breaks" should only be used when your text has artificial line breaks (PDF hard wraps). If your text has meaningful paragraph breaks, this option will merge everything into one block, which you probably don't want.
For text that will go into a database or a system with strict character requirements, check the output for any remaining unusual characters by scanning visually or pasting into a hex viewer if you suspect there are invisible characters the cleaner didn't catch.
Limitations
Text cleaning is a best-effort process. Some character encoding issues — particularly text that was incorrectly decoded from a non-UTF-8 source (mojibake, where characters like "’" appear instead of an apostrophe) — require a specific encoding correction step that generic text cleaners don't handle. If you're seeing garbled multi-character sequences, the source document needs to be re-exported with correct character encoding rather than cleaned after the fact.
This tool doesn't understand document structure — it can remove all line breaks, but it can't know that a line break represents a paragraph end versus a mid-sentence word wrap. You'll need to review the output for these contextual judgements.
Frequently Asked Questions
The converter supports 11 case styles: UPPERCASE, lowercase, Title Case, Sentence case, camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, aLtErNaTe, and iNVERSE cASE.
It processes your text in real time as you type. You can trim per-line leading/trailing spaces, collapse multiple consecutive spaces into one, remove blank lines, strip tab characters, or join everything into a single line — each option can be combined freely.
Any line that appears more than once. The tool keeps the first occurrence and removes all later copies. With "Trim whitespace" on, leading/trailing spaces are ignored when comparing. With "Case sensitive" off, "Apple" and "apple" are treated as the same.
No. All processing runs entirely in your browser using JavaScript. Your text never leaves your device.