Toolbaro

Text Cleaner

Clean up text copied from PDFs, spreadsheets and web pages: remove line breaks, extra spaces, empty and duplicate lines, sort lines, add or strip numbering, find and replace with regex, strip HTML tags. Runs in your browser; nothing is uploaded.

Lines 0 · Characters 0
Lines 0 → 0 · Characters 0 → 0

Your text is processed inside this browser and is never uploaded or stored. Only the steps and settings are saved in this browser.

How to use the text cleaner

Paste your text and the steps under Steps, in order run from top to bottom, with the result shown right away. Copy result copies it, and Use result as input lets you clean the result again.

Pick a step under Add a step to append it to the list. Use the arrow buttons to reorder and × to remove. Each step shows how many lines or characters it changed, and the result shows line and character counts before and after.

Common jobs

After choosing a preset you can still add, remove and adjust steps. The last steps and settings you used are saved in this browser for next time.

  • Fix line breaks from a PDF: remove invisible spaces → clean up spaces → remove line breaks. Sentences are joined again and paragraphs separated by an empty line stay apart.
  • Clean a list copied from Excel: remove invisible spaces → clean up spaces → remove empty lines → remove duplicate lines.
  • Clean text copied from a web page: strip HTML tags → remove invisible spaces → clean up spaces → keep at most one empty line.
  • Join a list with commas: turns one name per line into “Olivia, Liam, Emma”.
  • Remove duplicates and sort A–Z: clean up spaces → remove empty lines → remove duplicate lines → sort alphabetically.

What each step does

Steps run in order, so the order matters. Put numbering after removing duplicates, for example, so the numbers have no gaps.

  • Remove line breaks: joins lines. “Auto” puts a space between words but none between Chinese or Japanese characters. Joining with commas turns a list into one line.
  • Clean up spaces: trim each line, squeeze repeated spaces, or remove every space.
  • Remove empty lines: delete all empty lines, or keep at most one in a row.
  • Remove duplicate lines: keeps the first copy of each line.
  • Sort lines: alphabetical, by number, reversed or shuffled. Alphabetical order is natural, so “item 2” comes before “item 10”.
  • Add numbering / Remove numbering: number lines as 1. 1) (1) or ①, or strip existing numbers and bullets.
  • Add text before and after: with ' before and ', after, a list becomes 'value', lines ready for a SQL IN clause.
  • Strip HTML tags and invisible spaces: removes markup and hidden characters that come along when copying from web pages and PDFs.

Find and replace with regular expressions

Turn on Regex to search with a pattern. In the replacement, $1 and $2 insert captured groups, \n is a line break and \t is a tab. An invalid pattern skips only that step and shows the error, and a pattern that runs longer than 3 seconds is stopped.

  • (\d{3})(\d{3})(\d{4}) → ($1) $2-$3: 5551234567 becomes (555) 123-4567
  • (\d{4})-(\d{2})-(\d{2}) → $2/$3/$1: 2026-10-10 becomes 10/10/2026
  • \s*\(.*?\) → (empty): removes text in parentheses
  • ^ → > : quotes every line with >

From Excel to CSV and back

Cells copied from Excel or Google Sheets arrive as text with tabs between the columns. Set Tabs ↔ commas to “Tabs → commas” to get CSV; cells containing commas or line breaks are wrapped in quotes. Going the other way, CSV text converted to tabs pastes into Excel with each value in its own cell.

Your text stays on your device

Cleaning runs in a Web Worker inside this browser. Your text is never uploaded or stored, so you can clean customer lists, internal emails and other text you would not paste into an online service. Only the steps and settings are saved, in this browser.

FAQ

Removing line breaks also merged my paragraphs. How do I keep them?

Turn on “Keep paragraphs (empty lines)” in Remove line breaks. Paragraphs separated by an empty line stay apart and only the lines inside each paragraph are joined. If your text has no empty lines between paragraphs, add them first.

How do I remove every space?

Turn on “Remove all spaces” in Clean up spaces. Spaces and tabs are deleted and line breaks stay, which is handy for phone and account numbers.

Which copy does Remove duplicate lines keep?

The first one. Later lines with the same text are deleted. Spaces at the start and end are ignored when comparing, and empty lines are kept. Turn on “Ignore case” to treat Apple and apple as duplicates.

How does sorting by number work?

Lines are ordered by the first number in each line, including numbers with thousands separators such as 1,000 and decimals. Lines without a number keep their order at the end.

Why does text copied from a PDF have strange spaces?

PDFs and web pages often contain invisible characters such as non-breaking spaces (NBSP) and zero-width spaces. They break searches and spreadsheet formulas, so run Remove invisible spaces to normalize them.

Is my text uploaded or saved?

No. The text is processed in your browser and never sent anywhere, and nothing is left once you close the page. Only the steps and settings are kept in this browser (localStorage).

Loading…