JSON Wrench formats, validates and repairs JSON in your browser. Paste JSON into the editor above: valid JSON is formatted instantly, and broken JSON gets the exact line and column of the problem, a plain-English explanation and a one-click fix. It is built for the JSON developers actually run into: API responses, log lines, config files, escaped strings and Python dicts.
Formatting, validation and repair all run on your device. The JSON you paste is never uploaded or stored on a server, and there is no account to create. We use Google Analytics to count page visits; it never receives your JSON. Details are in the privacy policy.
Pretty-print with 2-space indentation and syntax highlighting. Numbers and strings are kept exactly as written, so 12345678901234567890 never turns into 12345678901234567000.
Every error gets its exact line and column, a specific name and a plain-English explanation. All problems are underlined in the editor at once.
One click repairs missing and trailing commas, quotes, comments, unclosed brackets and more. Every change is listed, and your input stays untouched until you choose to replace it.
Escaped JSON like "{\"id\":1}" from APIs, logs and databases is detected and decoded automatically, even when it was encoded several times.
Paste a printed Python dict. Single quotes, True, False and None are converted to valid JSON.
Timestamps and log prefixes before the JSON are removed, and several JSON objects in a row are handled.
Remove all whitespace for APIs, env vars and storage. Only whitespace is removed, so every value stays exact.
Explore nested data in a full-screen tree with types and sizes, expand or collapse any level, and copy any value, object or array.
Press Ctrl/Cmd + F to search inside the input or the output, with match highlighting.
Copy the result in one click or download it as data.json.
Create a link that opens your JSON in JSON Wrench. The JSON is compressed into the part of the URL after #, which browsers never send to a server.
Your last 5 valid documents are kept in your browser so you can reopen them. They are never uploaded.
Documents up to 5 MB are validated and formatted live in the browser.
Follows your system setting, or choose light or dark.
Copy the whole formatted or minified result with one click, or open the tree view and hover any value, object or array to copy just that part as JSON. Copy All in the tree copies the full document.
Instead of a generic "Unexpected token", JSON Wrench names the mistake. These are the errors it recognizes:
| HTML instead of JSON | The server most likely returned an error page or login redirect instead of JSON. Check the HTTP status code of the request. |
|---|---|
| Trailing comma | JSON does not allow a comma after the last item in an object or array, even though JavaScript and Python do. |
| Extra comma | There are two commas in a row (or a comma before the first item), which leaves an empty slot JSON can't represent. |
| Single quotes | JSON strings and keys must use double quotes. Single quotes usually come from copying a JavaScript object or a Python dict. |
| Unquoted key | Every key in a JSON object must be a string in double quotes. Bare keys are JavaScript object syntax, not JSON. |
| Unquoted text value | Text values must be wrapped in double quotes. Only numbers, true, false and null can appear without quotes. |
| Python value | This looks like a Python dict. JSON spells these values true, false and null (lowercase). |
| Invalid value | NaN, Infinity and undefined exist in JavaScript but not in JSON. JSON supports strings, finite numbers, true, false, null, objects and arrays. |
| Comment in JSON | Standard JSON has no comments. // , /* */ and # comments come from JSONC, JSON5 or YAML config files. |
| Missing comma | Two items sit next to each other without a comma between them. |
| Missing colon | Each key in an object must be followed by a colon and then its value: "key": value. |
| Unclosed bracket | The input ends before every { or [ is closed. The data may have been cut off when it was copied or logged. |
| Mismatched bracket | An object opened with { must close with }, and an array opened with [ must close with ]. |
| Unclosed string | A string was opened with " but never closed. |
| Raw line break or tab in string | Line breaks and tabs inside a string must be escaped as \n and \t. |
| Invalid escape sequence | Inside a string, a backslash must be followed by one of " \ / b f n r t or uXXXX. To include a literal backslash, write \\. |
| Invalid number | JSON numbers are stricter than most languages: no leading +, no leading zeros, no hex, and digits on both sides of a decimal point. |
| Extra text after JSON | There is leftover text after the JSON ends. A document must contain exactly one value. |
| Multiple JSON values | More than one JSON value was found (common with log lines or NDJSON). A single document can only hold one top-level value. |
| Invisible character | Text copied from web pages, Slack, Notion or Word often carries invisible characters (like non-breaking spaces) that look like spaces but aren't valid in JSON. |
| Curly quotes | Word processors and chat apps turn " into “smart” quotes. JSON only accepts the plain straight quote character. |
| Ctrl/Cmd + Shift + F | Format |
|---|---|
| Ctrl/Cmd + Shift + M | Minify |
| Ctrl/Cmd + Enter | Auto-fix errors |
| Ctrl/Cmd + F | Search in the input or output |
| Ctrl/Cmd + Z | Undo, including "Replace input with this" |
| Esc | Close the tree view |
Yes. Every feature is free, with no account and no usage limits.
No. Formatting, validation, repair, minifying and the tree view all run in your browser. The JSON you paste is never uploaded or stored on a server. We use Google Analytics to count page visits, and it never receives the JSON you paste.
Missing, trailing and doubled commas, single quotes, unquoted keys, Python values (True, False, None), comments, curly quotes, invisible characters, unclosed brackets and strings, NaN and Infinity, hex numbers, log prefixes and text after the JSON. If something cannot be repaired safely, it tells you why and changes nothing.
No. Formatting and minifying only move whitespace. Large numbers, decimals like 1.10, key order and duplicate keys are all kept exactly as you wrote them.
Documents up to 5 MB are validated and formatted as you type. Above that, validation pauses to keep the page responsive.
Yes. On narrow screens the input, the action buttons and the output stack vertically.
Press Share to copy a link that opens your JSON in JSON Wrench. The data is stored in the link itself after the #, so it works for documents up to about 4 KB once compressed.