Esta página ainda não foi traduzida para o português, por isso aparece em 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.

Atualizado em
Result

Seus dados nunca saem do seu computador. Todo o processamento acontece localmente no navegador.

Como 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.

Também pesquisado como: convert tabs to spaces, tab to space converter, spaces to tabs, replace tabs with spaces, fix indentation.

Ferramentas que combinam com: 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.

Perguntas frequentes

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.
Posso instalar o Tabs to Spaces como um aplicativo da web e usá-lo offline?
Sim. O Tabs to Spaces é um aplicativo da web instalável (PWA) — instalado a partir do seu navegador, não baixado de uma loja de aplicativos. Clique em “Instalar aplicativo” na parte superior desta página no Chrome ou no Edge (Windows, macOS, Linux, ChromeOS) ou, no Android, use “Compartilhar” → “Adicionar à tela inicial” no iPhone e no iPad, ou “Arquivo” → “Adicionar ao Dock” no Safari 17+ em um Mac. Em seguida, ela se abre em uma janela própria com seu próprio ícone e, como é executada inteiramente no seu navegador, continua funcionando offline. O Firefox no desktop não permite a instalação de aplicativos da web. Como funciona a instalação.

Ferramentas relacionadas