Text Cleaner

Convert case, strip extra spaces, remove duplicate lines, and sort text — all in one place.

Text Cleaner — Case, Spacing, Duplicates, and Sorting in One Place

Most "clean up my text" jobs come down to a handful of repetitive, fiddly edits: fixing the case of something you typed in the wrong style, stripping out spacing that snuck in from a copy-paste, removing repeated lines from a list, or putting a list in some kind of order. This tool bundles the four of those we get asked for most, as four tabs, so you're not hunting for four separate tools.

What's in each tab?

Case Converter: Turns your text into 11 different case styles — UPPERCASE, lowercase, Title Case, Sentence case, camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, aLtErNaTe, and iNVERSE cASE. Pick a button and the result appears in the output box below, ready to copy, swap back into the input, or download as a .txt file.

Remove Spaces: Cleans up whitespace with five independent options — trim leading/trailing spaces on each line, collapse multiple spaces into one, remove blank lines, remove tab characters (converted to a single space), and join everything into one line. Turn on whichever combination you need; the result updates as you type.

Remove Duplicates: Treats your input as one item per line and keeps only the first occurrence of each. You can make the comparison case-sensitive or not, trim whitespace before comparing, and choose whether to strip blank lines too. A stats bar shows the original line count, how many were removed, and how many remain.

Sort Text: Reorders a line-per-item list — alphabetically (A→Z or Z→A), by length (shortest or longest first), numerically (if your lines start with numbers), or randomly shuffled or reversed. Options let you sort case-insensitively, ignore leading symbols like bullets, trim whitespace first, and drop duplicates while you're at it.

Common use cases

Fixing case on pasted text: A heading typed in all caps that needs to be Title Case for a document, a variable name that needs to go from snake_case to camelCase for a different codebase, a sentence someone left in aLtErNaTe case as a joke that now needs fixing for real. The Case Converter tab handles all of these in one click.

Cleaning data for spreadsheets: Values pasted from websites or documents frequently have leading or trailing spaces that cause lookup functions like VLOOKUP or INDEX/MATCH to fail silently. Run the column through Remove Spaces before pasting it back in.

Merging email or keyword lists: Combine lists from a signup form, a spreadsheet, and a CSV export, and duplicates are inevitable. Remove Duplicates strips repeated addresses or keywords in one pass, with case-insensitive matching so "Apple" and "apple" count as the same entry.

Alphabetising a list for review: A list of names, product SKUs, or keywords is much easier to scan and check for gaps once it's sorted. Paste it into Sort Text and pick A→Z.

Preparing PDF or OCR text for reading: Text extracted from a scanned document or PDF often has irregular spacing and stray blank lines between paragraphs. Trim, collapse spaces, and remove blank lines together clean most of that up.

How to use it

Pick the tab for what you need done — case, spaces, duplicates, or sorting. Paste your text into the input box for that tab, set the options or pick a case style, and the result appears in the output box. Copy it, swap it back into the input, or download it as a .txt file. Switching tabs doesn't clear your work in the others.

Tips

In Remove Spaces, "Join all lines into one line" is meant for text with artificial line breaks — a PDF hard-wrap, a fixed-width export. If your paragraphs have real breaks you want to keep, leave it off.

In Remove Duplicates and Sort Text, "Trim whitespace" matters more than it looks — a line with an invisible trailing space won't match its clean duplicate unless trimming is on.

If you need a list both deduplicated and sorted, use the Sort Text tab's "Remove duplicates" option directly — it does both in one pass rather than needing two tabs.

Limitations

This tool doesn't touch HTML markup, character encoding, or smart-quote conversion — it works on the case, spacing, duplication, and order of plain text, nothing else. If your text has leftover HTML tags or mojibake from a bad encoding, you'll need to fix that separately before or after using this tool.

Remove Duplicates and Sort Text both work line by line. Neither one looks inside a line for duplicate words or a specific column in CSV-style data — for that, a spreadsheet or a script is the better tool.

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.

Related Text Tools