JSON Wrench

JSON Formatter, Validator & Fixer Online

Input
All processing happens in your browser. Your JSON is never uploaded.
Output
Paste JSON on the left. It's checked as you type. Broken JSON gets an exact error location and a one-click fix.

Free online JSON formatter, validator and fixer

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.

100% client-side. Your JSON never leaves your browser.

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.

Everything JSON Wrench does

Format & beautify

Pretty-print with 2-space indentation and syntax highlighting. Numbers and strings are kept exactly as written, so 12345678901234567890 never turns into 12345678901234567000.

Validate as you type

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.

Auto-fix broken JSON

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.

Auto-unescape

Escaped JSON like "{\"id\":1}" from APIs, logs and databases is detected and decoded automatically, even when it was encoded several times.

Python dict to JSON

Paste a printed Python dict. Single quotes, True, False and None are converted to valid JSON.

JSON from log lines

Timestamps and log prefixes before the JSON are removed, and several JSON objects in a row are handled.

Minify

Remove all whitespace for APIs, env vars and storage. Only whitespace is removed, so every value stays exact.

Tree view

Explore nested data in a full-screen tree with types and sizes, expand or collapse any level, and copy any value, object or array.

Search

Press Ctrl/Cmd + F to search inside the input or the output, with match highlighting.

Copy & download

Copy the result in one click or download it as data.json.

Share by link

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.

Recent history

Your last 5 valid documents are kept in your browser so you can reopen them. They are never uploaded.

Large documents

Documents up to 5 MB are validated and formatted live in the browser.

Dark mode

Follows your system setting, or choose light or dark.

Copy anything from your JSON

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.

JSON errors it explains

Instead of a generic "Unexpected token", JSON Wrench names the mistake. These are the errors it recognizes:

HTML instead of JSONThe server most likely returned an error page or login redirect instead of JSON. Check the HTTP status code of the request.
Trailing commaJSON does not allow a comma after the last item in an object or array, even though JavaScript and Python do.
Extra commaThere are two commas in a row (or a comma before the first item), which leaves an empty slot JSON can't represent.
Single quotesJSON strings and keys must use double quotes. Single quotes usually come from copying a JavaScript object or a Python dict.
Unquoted keyEvery key in a JSON object must be a string in double quotes. Bare keys are JavaScript object syntax, not JSON.
Unquoted text valueText values must be wrapped in double quotes. Only numbers, true, false and null can appear without quotes.
Python valueThis looks like a Python dict. JSON spells these values true, false and null (lowercase).
Invalid valueNaN, Infinity and undefined exist in JavaScript but not in JSON. JSON supports strings, finite numbers, true, false, null, objects and arrays.
Comment in JSONStandard JSON has no comments. // , /* */ and # comments come from JSONC, JSON5 or YAML config files.
Missing commaTwo items sit next to each other without a comma between them.
Missing colonEach key in an object must be followed by a colon and then its value: "key": value.
Unclosed bracketThe input ends before every { or [ is closed. The data may have been cut off when it was copied or logged.
Mismatched bracketAn object opened with { must close with }, and an array opened with [ must close with ].
Unclosed stringA string was opened with " but never closed.
Raw line break or tab in stringLine breaks and tabs inside a string must be escaped as \n and \t.
Invalid escape sequenceInside a string, a backslash must be followed by one of " \ / b f n r t or uXXXX. To include a literal backslash, write \\.
Invalid numberJSON 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 JSONThere is leftover text after the JSON ends. A document must contain exactly one value.
Multiple JSON valuesMore than one JSON value was found (common with log lines or NDJSON). A single document can only hold one top-level value.
Invisible characterText 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 quotesWord processors and chat apps turn " into “smart” quotes. JSON only accepts the plain straight quote character.

Keyboard shortcuts

Ctrl/Cmd + Shift + FFormat
Ctrl/Cmd + Shift + MMinify
Ctrl/Cmd + EnterAuto-fix errors
Ctrl/Cmd + FSearch in the input or output
Ctrl/Cmd + ZUndo, including "Replace input with this"
EscClose the tree view

Guides for common JSON problems

Frequently asked questions

Is JSON Wrench free?

Yes. Every feature is free, with no account and no usage limits.

Is my JSON sent to a server?

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.

What kinds of broken JSON can it fix?

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.

Does formatting change my data?

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.

How big a file can I format?

Documents up to 5 MB are validated and formatted as you type. Above that, validation pauses to keep the page responsive.

Does it work on a phone?

Yes. On narrow screens the input, the action buttons and the output stack vertically.

How do I share JSON with someone?

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.