Diese Seite ist noch nicht auf Deutsch verfügbar, daher zeigen wir die englische Version.

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.

Aktualisiert am
Result

Deine Daten verlassen nie deinen Computer. Die Verarbeitung erfolgt zu 100 % lokal im Browser.

So nutzt du: 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.

Auch gesucht als: convert tabs to spaces, tab to space converter, spaces to tabs, replace tabs with spaces, fix indentation.

Passende Tools zu: 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.

Häufige Fragen

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.
Kann ich Tabs to Spaces als Web-App installieren und offline nutzen?
Ja. Tabs to Spaces ist eine installierbare Web-App (PWA) – sie wird über Ihren Browser installiert und nicht aus einem App-Store heruntergeladen. Klicken Sie oben auf dieser Seite in Chrome oder Edge (Windows, macOS, Linux, ChromeOS) auf „App installieren“ oder verwenden Sie auf Android-Geräten „Teilen“ → „Zum Startbildschirm hinzufügen“ auf dem iPhone und iPad bzw. „Datei“ → „Zum Dock hinzufügen“ in Safari 17+ auf einem Mac. Die App öffnet sich dann in einem eigenen Fenster mit einem eigenen Symbol, und da sie vollständig in Ihrem Browser ausgeführt wird, funktioniert sie auch offline. Firefox auf dem Desktop kann keine Web-Apps installieren. So funktioniert die Installation.

Ähnliche Tools