Skip to content
utilhex

Text Cleaner & Line Tools

Runs in your browserFree · No sign-up

Remove duplicate lines, sort lists, delete line breaks and extra spaces, find and replace with regex, and add prefixes, all at once. Free, instant, private.

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

  1. Paste your text or list.
  2. Turn on the cleaning steps you want. They run in a fixed order, shown under the panes.
  3. Check the summary of what changed.
  4. 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

StepEffect
Trim each lineRemoves spaces and tabs at the start and end of every line
Remove extra spacesTurns runs of spaces or tabs inside a line into one space
Remove duplicatesKeeps the first (or last) copy of each line; can ignore case
Remove empty linesDeletes blank lines, including ones with only spaces
SortA→Z, Z→A, natural (2 before 10), by length, reverse, or shuffle
Line breaksJoins all lines, or joins lines inside paragraphs only
Find & replacePlain 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.