Skip to content
Jellykit

Remove Extra Spaces

Turn double spaces, tabs and runs of blank characters inside each line into a single space, leaving every line break where it was.

  • Runs on your device
Loading tool

About Remove Extra Spaces

Text from PDFs, scanned documents and justified layouts is full of double spaces and stray tabs between words. This reduces every run of spaces and tabs to one ordinary space, line by line, so the words read and search normally again.

Line breaks are left in place. Non-breaking and full-width spaces count as spaces too, and become ordinary ones.

How it works

  1. The text is split into lines at any kind of line break, and the ending used in the input is used again in the output.
  2. Clean-ups run in this order: non-printing characters, trimming, collapsing spaces, empty lines, duplicates, and finally the line order.
  3. Duplicates are compared after the earlier steps, keeping the first occurrence. Accented letters typed in different ways count as the same.
  4. Sorting uses your browser language rules, so accented letters sort next to their base letter. Shuffling uses the browser secure random generator.

Questions

Does it join lines together?

No. It works inside each line only, so paragraphs and lists keep their line breaks. Turn on "Remove empty lines" to also drop blank lines.

What happens to indentation?

Leading spaces are collapsed to one space as well. Turn on "Trim each line" to remove them completely.

Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.