How it works
Paste JSON into the input box and pick an action. Beautify re-indents your data into a readable, nested layout using the indent you choose (2 spaces, 4 spaces, or a tab). Minify strips every optional space and newline to produce the smallest valid form: useful before storing a payload in a database column, a cache, or an HTTP header where byte count matters. Validate checks the syntax without changing anything. All three first run the text through the browser's own JSON.parse, so a document that beautifies or minifies is guaranteed to be well-formed JSON.
Read the feedback strip below the buttons. On success you get a green Valid JSON badge plus the parsed type (object, array, string, number, boolean, or null), a count of top-level keys for an object or items for an array, and the total character length. The key/item count is only the outermost level: it does not recurse into nested structures, so treat it as a quick shape check, not a full node census. On failure you get the parser's exact message, which typically names what it expected and the character position where parsing stopped (for example Unexpected token } in JSON at position 42). Position is a zero-based character offset from the start of the text; jump there in your editor to find the real culprit, which is often a missing comma or quote just before that point.
Common JSON syntax errors
JSON is stricter than JavaScript object literals. These are the mistakes that make JSON.parse throw: all are rejected by the standard, so validation here catches every one.
| Mistake | Invalid | Correct |
|---|---|---|
| Trailing comma | [1, 2, 3,] | [1, 2, 3] |
| Single quotes | {'a': 1} | {"a": 1} |
| Unquoted key | {a: 1} | {"a": 1} |
| Comment | {"a": 1} // note | {"a": 1} |
| Non-finite number | {"n": NaN} | {"n": null} |
| undefined value | {"a": undefined} | {"a": null} |
| Leading zero / hex | {"n": 0xFF} | {"n": 255} |
| Unescaped control char | {"s": "a b"} | {"s": "a\tb"} |
Keys and string values must use double quotes. The only literals allowed outside of strings and numbers are true, false, and null. Numbers must be finite decimal, no NaN, Infinity, hexadecimal, or leading zeros.
Frequently asked questions
Why does my JSON with comments fail to validate?
The JSON standard has no comment syntax, so // and /* */ both cause a parse error. Formats like JSONC or JSON5 add comments and trailing commas, but they are supersets, strip those extras before parsing as strict JSON. Config files that "look like JSON" (such as tsconfig) are often actually JSONC.
What does "Unexpected end of JSON input" mean?
The parser reached the end of the text while still expecting more: usually an unclosed bracket, brace, or string quote. Check that every { and [ has a matching close and that no string is missing its closing double quote. Beautifying a partial document will fail for the same reason.
Does formatting change my numbers or key order?
Beautify and minify re-serialize the parsed value, so whitespace changes but data does not, with two caveats. Object keys keep their original insertion order, and very large integers beyond JavaScript's safe range (2^53 − 1) or high-precision decimals can lose precision because they pass through a native number. If exact precision matters, keep such values as strings.
Is minified JSON different data from beautified JSON?
No. Minifying only removes insignificant whitespace between tokens; the two forms parse to exactly the same value. Whitespace outside of strings carries no meaning in JSON, so a minified payload and its pretty-printed version are interchangeable.
Can I paste a whole API response or NDJSON file?
A single JSON document (one object or array) works fine. Newline-delimited JSON (NDJSON / JSON Lines), where each line is its own document, is not itself valid JSON and will fail, parse one line at a time instead.