JSON formatter. Validate, pretty, minify.
Paste JSON. We parse it in your browser, render the prettified version with sortable keys, surface parse errors with line + column, and offer one-click minify, escape, and unescape. Nothing leaves the page.
Paste JSON in the left panel. The right panel shows the prettified, validated version live. Toggle indent (2 / 4 spaces), sort keys alphabetically, minify to one line, escape for embedding, unescape from a quoted string. Browser-only — your JSON is never uploaded.
// formatted output appears here
Privacy: JSON is parsed in your browser. Nothing is sent or logged.
Five common mistakes strict JSON catches.
Trailing commas. JavaScript object literals allow them; RFC 8259 strict JSON does not. {"a": 1,} parses in dev, fails when posted to a strict API. The error message names the position; remove the comma and re-validate.
Single quotes. Common in JavaScript, illegal in JSON. {'name': 'value'} is invalid; {"name": "value"} is the only legal form. The parser will point at the first single quote it finds.
Unquoted keys. Same dialect issue. {name: "value"} is JavaScript syntax, not JSON. Wrap every key in double quotes.
Embedded comments. JSON does not support comments. // comment or /* comment */ inside JSON will fail. The non-strict variant JSONC (used by tsconfig.json) does — but stripping comments is a separate step before strict-JSON parsing.
Unescaped control characters in strings. Tabs, line breaks, and form feeds inside string values must be escaped (\t, \n, \f). Pasting a multi-line string directly into a JSON value breaks parsing. The escape button on the toolbar handles this for you.
Four jobs this tool covers.
Job 1: API debugging. An API returns a 400 with "invalid JSON in request body." Paste the body here. The parse-error line + column points at the broken character. Most often it's a trailing comma after a templated field, or an unescaped quote inside a string value. Fix and re-send. Faster than reading the server's stack trace.
Job 2: Diff-friendly normalization. Two API responses look different but contain the same data. Sort-keys both and minify both — the diff collapses to genuine differences instead of cosmetic key-order noise. Useful in test snapshot updates and contract-test failure triage.
Job 3: Embedding JSON inside JSON. When one API field needs to contain a JSON document as a string (a common pattern for webhook payloads or log entries), the inner document must be escape-stringified. Paste the inner JSON, hit escape, and the result is the safely-quoted string you can drop into the outer field's string value. Unescape goes the other way for log analysis.
Job 4: Pretty-printing for humans. Logs, API responses, config files — most JSON in the wild is minified or hand-formatted inconsistently. Two-space indent is the JavaScript-ecosystem default; four-space is the Python convention. Tab is what gofmt uses for Go-derived configs. Pick the indent that matches the rest of your codebase. Pair with our JSON Validator if you need schema validation against a JSON Schema document.
Six questions users ask.
Is the JSON I paste sent anywhere?
No. We use the browser's native JSON.parse and JSON.stringify — both run entirely client-side. The page is static HTML; the only network request is the initial page load. Safe for JSON containing API keys, customer records, internal config, or anything else you would not want to upload to a third party. Many free JSON tools online send data to their server for 'processing'; we never do.
What does 'sort keys' do?
Recursively re-orders every object's keys alphabetically (case-insensitive). Useful for diffing two API responses where the server returned the same data but in different key order — sort both and the diff collapses to genuine differences. Also useful for normalising JSON before storing as a fingerprint or hashing for cache keys. Arrays are not re-ordered (order is meaningful for arrays); only object keys move.
What's the difference between escape and unescape?
Escape converts JSON-special characters (quotes, backslashes, newlines, tabs) into their backslash-escaped form, so the result is safe to paste inside a JSON string value. Useful when you have a JSON document and need to embed it as a string field of another JSON document. Unescape does the reverse — turns an escaped JSON string back into the original raw JSON. Both operate on the textarea content as a whole, not the parsed object.
How do you find parse errors?
When JSON.parse throws, the error message includes a position offset. We compute the line and column from that offset and render both, plus the surrounding 40 characters with the error position marked. Common errors we surface: trailing comma after the last element of an array or object (illegal in strict JSON), single quotes instead of double, unquoted keys, embedded comments, control characters in strings. Each gets a one-line plain-language explanation.
Why no JSON5 / JSONC support?
JSON5 (the relaxed dialect that allows comments, trailing commas, and unquoted keys) and JSONC (Microsoft's variant for tsconfig.json and similar) are different parse rules. We focus on strict JSON per RFC 8259 because that's what every API uses. If you need JSON5, paste into the input and the error message will tell you which line is the JSON5-specific construct — usually a comment or a trailing comma — that needs removing for strict-JSON validity.
What's the maximum size?
Limited only by your browser's memory and the responsiveness of JSON.parse on your machine. Modern browsers comfortably handle 10-50 MB JSON documents in a few hundred milliseconds. Above that, the textarea itself becomes sluggish to type into. For very large files (100MB+), use jq or a streaming JSON parser at the command line — the right tool for that scale isn't a web textarea.