JSON Formatter & Validator
Paste or upload JSON, format it, minify it, catch syntax errors with exact line/column numbers, and explore the result as a collapsible tree - all client-side, nothing leaves your browser.
JSON syntax cheat sheet
| Type | Example | Note |
|---|---|---|
| Object | { "key": "value" } | Unordered set of key/value pairs. Keys are always double-quoted strings. |
| Array | [1, 2, 3] | Ordered list of values. Items can be mixed types. |
| String | "hello\nworld" | Double quotes only. Supports \n \t \" \\ \uXXXX escapes. |
| Number | -12.5e3 | No leading zeros, no NaN/Infinity, no hex/octal literals. |
| Boolean | true / false | Lowercase only — no True, no 1/0. |
| Null | null | Lowercase. There is no `undefined` in JSON. |
Shortcut: press Ctrl/Cmd + Enter to format from anywhere on the page.
Things to keep in mind
No trailing commas
{ "a": 1, } is invalid — remove the comma after the last item.
No comments
JSON has no // or /* */ syntax. Strip comments before parsing, or use JSON5/JSONC if you need them.
Double quotes only
'single quotes' and unquoted keys like { name: "x" } are not valid JSON.
Numbers lose precision
JSON numbers map to IEEE-754 doubles — integers beyond 2^53 (e.g. large IDs) can silently change. Send them as strings if exactness matters.
Duplicate keys: last one wins
{ "a": 1, "a": 2 } parses to { "a": 2 } in most parsers — don't rely on the first value.
No native dates
Dates aren't a JSON type. Use ISO-8601 strings ("2026-08-01T00:00:00Z") and parse on the receiving end.
Top level can be any value
"just a string" and 42 are both valid JSON documents — not everything is an object or array.
Control characters must be escaped
Raw newlines/tabs inside a string are illegal — they must appear as \n, \t, etc.