What this tool does
- Formats (beautifies) JSON with 2 spaces, 4 spaces or tabs.
- Validates as you type. If something’s wrong, you still see your JSON laid out, with the exact character marked and a plain-English explanation right under it. No more hunting for “column 2,555” in a one-line blob.
- Fixes the usual mistakes in one click: trailing commas, missing commas, single quotes, unquoted keys, comments and missing brackets.
- Minifies JSON to a single line for payloads, env vars or query strings.
- Sorts keys recursively, which makes two JSON files much easier to diff.
Shortcuts: ⌘ Enter formats, Shift ⌘ Enter minifies. For big payloads, the full-screen button gives you the whole window, and Esc brings you back.
The most common JSON errors
Trailing commas
{ "name": "Ada", "admin": true, } ✗
{ "name": "Ada", "admin": true } ✓Single quotes
{ 'name': 'Ada' } ✗
{ "name": "Ada" } ✓Unquoted keys
{ name: "Ada" } ✗
{ "name": "Ada" } ✓Special values
undefined, NaN, Infinity, functions and dates aren’t valid JSON values. Use null, a number, or an ISO 8601 string like "2026-11-13T09:30:00Z".
Formatting JSON in code
JavaScript and Node:
JSON.stringify(value, null, 2) // pretty
JSON.stringify(value) // minifiedPython:
import json
json.dumps(value, indent=2, sort_keys=True)Command line, with jq:
cat data.json | jq . # pretty
cat data.json | jq -c . # minified
cat data.json | jq -S . # sorted keysGot a JSON Web Token instead? Try the JWT decoder. Base64-encoded JSON? Use the Base64 decoder first.
Questions people ask
Is my JSON sent to a server?
No. Parsing and formatting happen in your browser with the native
JSON.parse, so it’s safe to paste API responses, config and tokens. You can even use the page offline once it’s loaded.Why does my JSON say “Expected a property name”?
Almost always a trailing comma, like
{"a": 1,}. JSON doesn’t allow them, even though JavaScript does. Remove the last comma before the closing brace or bracket.Can I use single quotes or comments?
Not in standard JSON. Strings and keys need double quotes, and comments aren’t allowed. Formats like JSON5 and JSONC allow them, but most APIs and parsers will reject them. Paste them here anyway and hit Fix: the tool converts quotes, quotes your keys and strips comments for you.
Can it fix broken JSON automatically?
For the usual mistakes, yes: trailing commas, missing commas, single quotes, unquoted keys, comments, missing closing brackets, and Python or JavaScript values like
True, None and undefined. The Fix button tells you exactly what it will change, and ⌘ Z undoes it.How big a file can it handle?
Several megabytes is fine. Syntax highlighting turns off above about 400 KB to keep typing smooth, but formatting and validation still work.
Does sorting keys change my data?
No. Object key order isn’t meaningful in JSON, so sorting only changes how it reads. Array order is always kept. Sorted keys make diffs much cleaner.