So verwenden Sie diesen Rechner
When the JSON formatter earns its place
Every developer has hit the wall of a single-line API response: hundreds of characters of JSON with no whitespace, and the one field you need hiding somewhere in the middle. That is the formatter’s home turf. Paste the response in, and the tool re-indents every object and array with two spaces so the structure becomes visible at a glance — which property lives in which object, and how deep the nesting goes. The same action validates the document, so a config file you edited by hand is checked for grammar at the same time. Reviewing a pull request? A formatted copy makes the diff legible instead of a wall of text. Extracting an error payload from a failed request? Same flow. Because everything runs locally, this is also the safe option for documents that carry API tokens, private keys, or personal data — nothing is uploaded, logged, or stored, so you can format a credential-bearing fixture without shipping it anywhere.
The tool is deliberately strict: it accepts standard JSON only, with the same grammar the browser’s JSON.parse accepts. That strictness is the feature. A document that parses here will parse in any JavaScript runtime, in Node, and in most CI tooling — which makes the tool a cheap pre-commit gate. It is equally useful the other way around: when a server or a script hands you JSON that fails to parse, the formatter tells you exactly where the grammar breaks, so you can fix the source rather than the symptom. Keep it in mind whenever you copy JSON out of a database, a generated file, or an email and want to know it is intact before it goes anywhere. If your text is close to JSON but not JSON — YAML, JSON5, a config file with comments — this is the wrong tool, and it will tell you so.
Formatting a document, step by step
Open the tool and paste your JSON into the input textarea — that is the only required field. Then click Format. If the document is valid, the formatted result appears in the output box below, indented with two spaces, and the stats row under it reports the input size, line count, minified size, and formatted size in bytes. Two further actions matter. Validate checks grammar without producing output — the answer you want when you only need a yes-or-no before committing a file. Clear empties both boxes and returns focus to the input, which is faster than selecting text by hand between runs. Once you are happy, Copy puts the formatted text on your clipboard, and Download saves it as a .json file named toolivaro-format.json — handy when you want to drop a cleaned-up fixture into a repository or an issue.
The most common missteps show up immediately. Paste nothing and click Format, and the tool answers with “Paste some JSON first.” — a gentle nudge rather than an error. Paste invalid JSON, and no output is produced; instead the tool reports the parser’s message with a position, like (position 66), so you can find the exact character that breaks the grammar. Trailing commas, single-quoted strings, unquoted keys, and comments are all rejected on purpose — this tool does not guess what you meant the way a permissive formatter might. Expect two-space indentation only; there is no setting for tabs or four spaces in this version. And remember that the input box accepts whatever you paste, so confirm you pasted the whole document — truncating a large response at the start or end produces a validation error that is really a copy problem.
Two details make the workflow predictable. The tool keeps no history between visits: there is no autosave, no paste log, and nothing survives a page reload — open the page, format, close, and the document is gone with the tab. That is intentional and worth leaning on: it makes the formatter safe to use with tokens or private keys without worrying about a browser-stored copy of them. And the Copy action writes exactly what the output box shows, so what you paste elsewhere is what you saw on screen — the formatted document, nothing re-validated or re-indented behind your back. Download saves the same content to a file, which is the cleanest way to hand a cleaned-up fixture to a repository or an issue.
Reading the output, the stats, and the errors
The output box holds the formatted document: one property per line, nested objects and arrays indented two spaces per level, and every string, number, and boolean exactly as it was in the input. Formatting never changes the data — for valid JSON the parse-and-re-stringify round trip is lossless, so the formatted copy is the same document with whitespace added. The stats row tells you what readability costs: “Input 61 B · 1 line · minified 61 B (−0%) · formatted 78 B” means the compressed form is 61 bytes and the pretty form 78. The size-comparison bars show the same relationship visually, scaling both against the larger. A gap of 17 bytes on a small payload is nothing; on a big API payload, minified output can matter for storage or transfer budgets — which is why the tool always shows both.
Errors are the other half of reading the output. When the parser rejects the document, the tool shows the engine’s message plus a position — “Expected double-quoted property name in JSON at position 66 (position 66)” for a trailing comma, for instance — and marks the input as invalid. The exact wording comes from the browser’s own JSON parser, so it can differ slightly across engines, but the position always points at the character where parsing stopped. Two limits are worth knowing. First, validation is grammatical, not semantic: a document that parses can still be wrong for your application — the wrong key, the wrong type — and no tool can catch that for you. Second, documents of hundreds of megabytes will slow the browser, so the tool is designed for typical configs and API payloads rather than database dumps.
Wie wird das Ergebnis berechnet?
Formatieren einer komprimierten API-Antwort
Eine API liefert {"status":"ok","items":[{"id":1,"name":"A"},{"id":2,"name":"B"}]}. Der Formatierer erzeugt eine Eigenschaft pro Zeile mit Zwei-Leerzeichen-Einrückung, sodass die Verschachtelung auf einen Blick sichtbar ist. Das Statistik-Panel zeigt: Die Eingabe hat 68 Bytes, die formatierte Version 101 Bytes — das ist der Preis der Lesbarkeit in Leerraum.
Beispieleingabe und -ausgabe | Eingabe | Wert |
| json | {"status":"ok","items":[{"id":1,"name":"A"},{"id":2,"name":"B"}]} |
| Ergebnis | Gültiges JSON · mit 2 Leerzeichen Einrückung · Eingabe 68 B → formatiert 101 B |
Formatting a Unicode-heavy API response
A weather service returns conditions for several cities in a single minified line, including names in their local spellings: München, José, and a fire emoji for the alert level. Pasted as-is, the payload is one dense line, and the accented characters make it easy to lose your place. Format the payload and the tool expands it to one property per line, so the four fields — city, temp, emoji, name — become instantly readable. The stats row then tells a story that surprises people the first time: the input weighs 61 bytes but is only 57 characters. Bytes are like postage stamps: a letter’s weight depends on the characters inside it, not just on how many there are. The ü in München takes two bytes, the é in José two, and the fire emoji four, while plain ASCII letters take one each. The formatted copy comes in at 78 bytes, all of it readable UTF-8. That distinction matters in practice: when you minify and store the payload later, byte size — not character count — is what your database column and your transfer limits see. The stats row shows both figures side by side, so you can weigh readability against size before the result goes anywhere. The example also shows validation passing silently: the payload parses on the first Format click, so the tool goes straight to output, and a quick Copy drops the readable version into a ticket or a pull request description. No settings are needed, and there is nothing to configure: paste, format, read the stats, copy. That one-click round trip is the point of a local utility.
Beispieleingabe und -ausgabe | Eingabe | Wert |
| json | {"city":"München","temp":23.5,"emoji":"🔥","name":"José"} |
| Ergebnis | Valid JSON · formatted with 2-space indent · input 61 B → formatted 78 B |
Tracking down a validation error after a hand edit
Hand-editing a generated config file — an environment file listing services and deployment regions — is where trailing commas sneak in. You add one more region to the array and, out of habit, leave the comma that used to precede the closing bracket: the array now ends with a comma, then a brace. The formatter refuses to produce output and instead reports the parser’s message with a position: “Expected double-quoted property name in JSON at position 66 (position 66)”. Read it like a copy editor proofreading a headline twice: the message names the exact problem, and the position pinpoints it. The parser reached the end of the array, found a comma, then found the closing brace where another property name should have been. Position 66 is where that unexpected brace sits, counting characters from the start of the document, and the stray comma at position 65 caused it — delete the comma and the document parses. The tool marks the input as invalid and leaves the output box empty, so there is no half-formatted result to mislead you. The fix is mechanical, not a hunt: go to the reported character, look one step back for the stray punctuation, and remove it. Validate is the cheap way to run this check without reformatting anything: click Validate, see the error, fix the text, click again, and the tool answers “Valid JSON.” That loop — paste, validate, fix, validate — is the fastest way to clean up hand-edited configuration before it goes anywhere near a server, and it works for any of the classic grammar slips: trailing commas, single quotes, unquoted keys, comments. The error message always tells you where to look, never just that something is wrong.
Beispieleingabe und -ausgabe | Eingabe | Wert |
| json | {"service":"api","env":"prod","regions":["us-east-1","eu-west-1"],} |
| Ergebnis | Invalid JSON — Expected double-quoted property name in JSON at position 66 (position 66) |
Häufig gestellte Fragen
Ist Formatieren bei JSON mit doppelten Keys sicher?
Der Parser behält für einen doppelten Key den letzten Wert (Standard-JSON-Verhalten), und der Formatierer erhält exakt das, was der Parser akzeptiert hat. Wenn doppelte Keys für dich relevant sind, validiere mit deinem eigenen Schema — JSON selbst verbietet sie nicht.
Warum schlägt meine JSON-Validierung fehl?
Häufige Ursachen: abschließende Kommas, Strings mit einfachen Anführungszeichen, Keys ohne Anführungszeichen, Kommentare und überzähliger Text nach dem Dokument. Die Fehlermeldung enthält, wann immer möglich, die Position im Parser, damit du direkt zur Problemstelle springen kannst.
Unterstützt dieses Tool JSON5 oder YAML?
Nein — dieses Tool akzeptiert ausschließlich Standard-JSON. Kommentare und abschließende Kommas sind JSON5-Features und werden bewusst abgelehnt; nutze für diese Formate einen eigenen Konverter.
Why do the byte counts look higher than my character count?
Because bytes and characters are not the same thing. The tool measures size in UTF-8 bytes: ASCII letters and digits take one byte each, while accented characters like ü or é take two, and emoji take four. A 57-character document can therefore weigh 61 bytes. The byte figure is what storage and transfer limits actually use, so it is the honest number to compare.
What is the difference between Format and Validate?
Format parses the document, checks the grammar, and writes the pretty-printed result into the output box with full size stats. Validate runs the same parse but reports only a verdict — “Valid JSON.” or an error with position — and leaves the output box untouched. Use Validate when you want a quick check without reformatting, for example before committing a config file you already formatted.
How large a document can I format?
There is no hard cap, but the tool parses synchronously in the browser, so very large documents — hundreds of megabytes — will slow the page and may freeze the tab for a while. It is designed for typical configs and API payloads. For multi-gigabyte dumps, use a streaming parser in a script instead; anything you can paste, this tool handles.