About Text Cleaner & Line Tools
Text Cleaner fixes messy text and lists in one place. Turn on the steps you need (remove duplicate lines, remove empty lines, trim, sort A to Z or naturally, remove line breaks, collapse extra spaces, straighten smart quotes, find and replace with plain text or regular expressions, add something before or after each line, number lines) and the result updates as you type. A summary tells you exactly what changed, such as “Removed 42 duplicate lines”.
How to use Text Cleaner & Line Tools
- Paste your text or list.
- Turn on the cleaning steps you want. They run in a fixed order, shown under the panes.
- Check the summary of what changed.
- Copy the result or download it as .txt.
Examples
Clean an email list
Turn on Trim each line, Remove empty lines, and Remove duplicates with Ignore case to get one address per line, no repeats.
Fix text copied from a PDF
Choose Remove, but keep paragraphs under Line breaks to join the broken lines back into paragraphs.
Reformat dates
With Regular expression on, find (\d+)-(\d+)-(\d+) and replace with $3/$2/$1 to turn 2026-11-28 into 28/11/2026.
What each step does
| Step | Effect |
|---|---|
| Trim each line | Removes spaces and tabs at the start and end of every line |
| Remove extra spaces | Turns runs of spaces or tabs inside a line into one space |
| Remove duplicates | Keeps the first (or last) copy of each line; can ignore case |
| Remove empty lines | Deletes blank lines, including ones with only spaces |
| Sort | A→Z, Z→A, natural (2 before 10), by length, reverse, or shuffle |
| Line breaks | Joins all lines, or joins lines inside paragraphs only |
| Find & replace | Plain text or JavaScript regular expressions with $1 groups |
Limitations
- Works on plain text. Formatting such as bold or links isn't kept.
- Very large inputs (tens of megabytes) may feel slow on older phones.
Privacy
This tool processes everything locally in your browser tab. Your input is not uploaded to Utilhex or any third party, and it is discarded when you close or reload the page. Read the privacy policy for details.
Frequently asked questions
Does sorting handle numbers properly?
Choose Natural to sort item2 before item10, the way people expect. A→Z sorts character by character, so 10 comes before 2.
Can I remove duplicates that differ only in capitals?
Yes. Turn on Ignore case under Remove duplicates; “Apple” and “apple” then count as the same line.
Which regex flavour is used?
JavaScript regular expressions with Unicode support. Use $1, $2 for groups, $& for the whole match, and $<name> for named groups.
Is my text uploaded?
No. Everything happens in your browser as you type. The text isn't uploaded, stored, or logged, and the tool works offline once the page has loaded.