TOOL 01
JSON formatter
Pretty-print for reading, minify for shipping, and a real parser error when the payload is broken.
Paste JSON
Formatting and validation happen in the page. Nothing is transmitted.
What "valid JSON" actually means
JSON is a small grammar: objects, arrays, strings, numbers, booleans and null. It does not allow comments, trailing commas, single-quoted strings or unquoted keys. Those are JSON5 or JavaScript object literal features, and a strict parser will reject them — which is why a payload that works in a config file can fail in an API client.
This page calls the browser's JSON.parse, the same parser your application uses. If it accepts the text, the text is valid JSON; the error message points at the character position where parsing stopped.
Numbers are not arbitrary precision
JSON numbers become IEEE-754 doubles. Integers above 2⁵³ (9,007,199,254,740,992) lose precision, and identifiers that look numeric — order numbers, snowflake IDs — should be sent as strings. Formatting and re-serialising a large integer can change its value, so check before round-tripping financial or ID data.
Key order
Objects are unordered by specification, though JavaScript preserves insertion order for string keys. Do not build logic on key order; if order matters, use an array.
Questions
Why does my JSON fail here but work in JavaScript?
JavaScript object literals allow unquoted keys, single quotes and trailing commas. JSON does not. Wrap the object in quotes or convert it properly.
Can I format very large files?
The page handles a few megabytes comfortably. Much larger inputs will make the textarea slow before the parser is the bottleneck.
Does it preserve number formatting?
No. Numbers are parsed and re-serialised, so 1.0 becomes 1 and leading zeros disappear. Use strings if the text form matters.
Is the output safe to paste into code?
It is valid JSON, not JavaScript. If you need a JS literal, wrap it in parentheses or convert it deliberately.