Common JSON errors
| Wrong | Right | Why |
|---|---|---|
{"a": 1,} | {"a": 1} | No trailing commas |
{'a': 'b'} | {"a": "b"} | Double quotes only |
{a: 1} | {"a": 1} | Keys need quotes |
{"a": undefined} | {"a": null} | undefined is not JSON |
// comment | (remove) | No comments |
Why big numbers get changed elsewhere
JavaScript's built-in JSON.parse can't represent integers above 9,007,199,254,740,991 (253−1), so many online formatters silently turn an ID like 12345678901234567890 into 12345678901234567000. This tool re-prints every number exactly as written and tells you when such numbers are present.
What the buttons do
- Format — adds indentation and line breaks.
- Minify — removes all whitespace, e.g. for a request body.
- Sort keys — sorts the keys of every object alphabetically, handy for comparing two documents.
- Escape / Unescape — turns JSON into a quoted string literal, or turns an escaped string from a log back into JSON.
Frequently asked questions
Is it safe to paste private data?
Your input is processed only in this browser tab and is never uploaded or stored. As a habit, avoid pasting production secrets into any web tool.
What's the difference between JSON and a JavaScript object?
JSON is a stricter data format: keys and strings need double quotes, and trailing commas, comments, undefined and functions are not allowed.
Related tools
- Percentage Calculator — percent change, reverse %
- Date Calculator — days between dates