Eliminador d'espais en blanc

Paste messy text below to instantly collapse repeated spaces, trim leading and trailing whitespace, or strip out blank lines.

Cap clau d'API Res no surt del vostre navegador Ús il·limitat
Whitespace Remover — Trim Extra Spaces & Blank Lines Online

Your text

Cleanup mode

Cleaned result

0Characters before
0Characters after
De persones que utilitzen aquesta eina

Ressenyes

Carregant ressenyes…
Què és i com funciona?

How to clean up whitespace

  1. Paste text that has extra spaces, inconsistent indentation, or stray blank lines into the box on the left.
  2. Pick a cleanup mode: collapse repeated spaces, trim each line's edges, or strip every bit of whitespace.
  3. Optionally remove blank lines too, then copy the cleaned result on the right.
Casos d'ús

Where messy whitespace comes from

Copying text out of a PDF, an email client, or a spreadsheet cell often drags along double spaces, tabs, and trailing blank lines that aren't visible until you paste the text somewhere that renders them literally, like code or a CSV file. Cleaning it by hand means hunting for invisible characters one by one.

This tool handles the common cases in one pass: collapsing doubled-up spaces without touching your paragraph breaks, trimming stray spaces from the start and end of every line, or reducing an entire block down to a single clean line with normalized spacing.

  • Spreadsheet and database cleanup: trim stray leading/trailing spaces so "Jane Doe" and " Jane Doe" match in VLOOKUP, SQL joins, or exact-match filters.
  • Code and config formatting: normalize inconsistent indentation or collapse doubled spaces in pasted code, YAML, or JSON.
  • Web copy and SEO content: strip extra spaces left over from rich-text paste before publishing to a CMS.
  • CSV and data import prep: clean scraped or exported data so blank lines and stray spaces don't break parsing.
  • Slugs and identifiers: use "remove all whitespace" to turn a phrase into a compact, space-free string.
Les preguntes més freqüents

Preguntes freqüents

Is this whitespace remover really free, with no sign-up?+

Sí. L'eina funciona íntegrament amb JavaScript al vostre navegador: no cal cap compte, ni cap clau d'API, i no hi ha cap límit en la freqüència amb què la podeu utilitzar.

El meu text es puja a algun lloc?+

No. Tot el que enganxes es processa localment al teu dispositiu. Res no s'envia a un servidor, s'emmagatzema ni es registra.

What does "collapse spaces" do exactly?+

It finds any run of two or more spaces or tabs within a line and replaces it with a single space, without touching line breaks.

What's the difference between trim and remove all whitespace?+

Trim only removes spaces at the very start and end of each line. Remove all whitespace strips every space, tab and line break from the entire text, joining it into one continuous string.

Can I remove empty lines without touching the spacing inside lines?+

Yes, the "remove blank lines" option deletes any line that is empty or contains only whitespace, leaving the rest untouched.

Why do spreadsheet lookups fail even when the text looks identical?+

A stray leading or trailing space makes "Jane Doe" and " Jane Doe" different strings to VLOOKUP, SQL, or exact-match filters, even though they look the same. Run "Trim lines" to strip those invisible edge spaces from every row before you paste the data back.

Which mode should I use for code or config files?+

Use "Collapse spaces" to tidy doubled-up spaces inside lines without disturbing indentation, or "Trim lines" to strip stray trailing whitespace after each line — a common source of noisy diffs in version control.

Can I remove line breaks and turn a paragraph into one line?+

This tool's "Remove all whitespace" mode strips line breaks along with every space, joining text with no separators at all. If you want line breaks replaced with spaces so words stay separated, use the dedicated Line Break Remover tool instead.

Eines relacionades

Tools for Cleaning Text

Metodologia

Com funciona aquesta eina

Each mode applies a targeted pattern match to your text using JavaScript, running entirely in your browser — collapsing repeated spaces, trimming line edges, or stripping all whitespace, depending on what you select. Nothing you paste is sent to a server.

Darrera actualització: 28 d'agost de 2026.

Continua

Més eines a la caixa

Nou eines gratuïtes més sense clau d'API a la pàgina d'inici.