JSON
JSON Formatter / Minify / Validator
Formatierung (2 Leerzeichen Einrückung), Minifizierung und Validierung von JSON direkt im Browser.
JSON Formatter turns any JSON into a readable, indented form, compresses it into a single compact line, or checks it for syntax errors. Everything runs in your browser — nothing you paste is sent anywhere.
How to use it
- Format: paste JSON into the input — a 2-space indented result appears immediately.
- Minify: switch to Minify mode to get compact JSON with no whitespace, ready to embed in code or send over the network.
- Validate: if the JSON is invalid, the tool points to the exact line and character where the syntax error occurs.
Common uses
- Reading an API response that arrived as one long unbroken line.
- Checking configuration files (package.json, tsconfig.json, etc.) before a commit.
- Minifying JSON before pasting it into an environment variable or a one-line config.
Things to keep in mind
Formatting never changes data types or key order — only the whitespace and line breaks around values.
Valid JSON doesn't allow trailing commas, comments, or single quotes — if your input has those, run it through JSON Repair first.
Artikel zu diesem Tool: JSON Formatter: Formatieren, Minifizieren und Validieren
Häufig gestellte Fragen
Was ist der Unterschied zwischen Format und Minify?
Format fügt eine 2-Leerzeichen-Einrückung hinzu, damit JSON lesbar wird, während Minify alle unnötigen Leerzeichen zwischen den Tokens entfernt, um die Größe zu reduzieren — der Inhalt der Zeichenketten-Werte selbst bleibt dabei unangetastet.
Wird das eingefügte JSON an einen Server gesendet?
Nein, die gesamte Verarbeitung erfolgt vollständig im Browser über JavaScript, es wird nichts an einen Server hochgeladen.
Warum meldet der Validator einen Fehler, obwohl das JSON korrekt aussieht?
Ein häufiger Grund ist ein überzähliges Komma (trailing comma) vor einer schließenden Klammer — das ist im JSON-Standard nicht erlaubt, auch wenn manche Programmiersprachen es tolerieren.
Worin unterscheidet sich JSON5 oder JSONC von Standard-JSON?
Es handelt sich um Erweiterungen, die zusätzlich Kommentare, trailing commas und nicht in Anführungszeichen gesetzte Schlüssel erlauben. Ein strikter JSON-Validator (wie dieses Tool) lehnt solchen Text zu Recht ab — dafür braucht es einen eigenen Parser, der JSON5/JSONC explizit unterstützt.
Verändert das Formatieren die Datentypen, z. B. Zahlen?
Nein, Formatieren und Minifizieren verschieben nur Leerzeichen und Zeilenumbrüche rund um die Werte. Zahlen, Strings, Booleans und null bleiben im Original erhalten.