Esta página aún no está traducida al español, así que la mostramos en inglés.

Convert Tabs to Spaces

Replace every tab with spaces — 2 by default; change it to 4 if your project uses that — to fix mixed indentation before you commit or paste code.

Actualizado el
Result

Tus datos nunca salen de tu ordenador. Todo se procesa localmente en tu navegador.

Cómo usar: Tabs to Spaces

  1. Paste your code — tabs are replaced with two spaces.
  2. For four spaces, type four spaces in Replace.
  3. Copy the result.

Spaces back to tabs

Set Find to ^( {4})+… or more simply to four spaces with Regex off, and Replace to . To make the change consistent across a project, add an .editorconfig — generate one with the EditorConfig Generator.

También se busca como: convert tabs to spaces, tab to space converter, spaces to tabs, replace tabs with spaces, fix indentation.

Herramientas que combinan con: Tabs to Spaces

  • Find and Replace — Paste text and replace words or patterns — case-sensitive or not, whole words only, or with regular expressions and $1 capture groups.
  • Line Ending Converter — See which line endings a file uses and convert them — Windows CRLF to Unix LF or back — for pasted text or a whole batch of files, with trailing-space and tab cleanup on the side.
  • JavaScript Formatter — Unminify and pretty-print JavaScript, JSON or JSX with your preferred indentation and brace style — or strip whitespace and comments with a verified minifier.
  • Remove Extra Spaces — Collapse double spaces, runs of spaces and stray tabs into a single space — line breaks are kept.

Preguntas frecuentes

How many spaces is a tab?
There’s no fixed rule: 2 is common in JavaScript and web projects, 4 in Python and Java.
Does it only change indentation?
It replaces every tab. To change only leading tabs, use the pattern ^ + and adjust the replacement.
Is my code uploaded?
No. It runs in your browser.
¿Puedo instalar Tabs to Spaces como aplicación web y utilizarla sin conexión?
Sí. Tabs to Spaces es una aplicación web instalable (PWA): se instala desde el navegador, no se descarga desde una tienda de aplicaciones. Haz clic en «Instalar aplicación» en la parte superior de esta página en Chrome o Edge (Windows, macOS, Linux, ChromeOS) o, en Android, utiliza «Compartir» → «Añadir a la pantalla de inicio» en iPhone y iPad, o «Archivo» → «Añadir al Dock» en Safari 17+ en un Mac. A continuación, se abrirá en su propia ventana con su propio icono y, como se ejecuta íntegramente en tu navegador, seguirá funcionando sin conexión. Firefox en el ordenador de sobremesa no permite instalar aplicaciones web. Cómo funciona la instalación.

Herramientas relacionadas