JSON Formatter
About JSON Formatter
Paste and go. Format re-indents with two spaces, four spaces or tabs. Minify strips every optional space and returns a single line. Validate only checks the structure and reports how many keys, items and levels deep it goes, leaving the content alone.
When parsing fails you get the line and column, plus the offending line with a caret under the exact position, so there is no counting characters by hand.
The same page converts to CSV or YAML, escapes a block of text into a quoted string, and reverses that escape. Handy when wiring up an API, reading a log dump, or feeding a spreadsheet.
Three behaviours come from JSON itself rather than from this page. Integers beyond 2 to the 53rd lose precision, so long IDs are safer kept as strings. Duplicate keys collapse to the last one. Comments are not part of the format, so a config file that carries them fails outright.
Frequently asked questions
Why did my long number change?
JavaScript numbers are doubles, so integers beyond 2^53 are not stored exactly. Order IDs and snowflake IDs are safer as strings from the start.
Can it handle JSON with comments?
No. Comments are not part of the format, so either strip them or use a parser that supports them.
What does CSV export expect?
An array at the top level, with objects or arrays inside. Nested objects are packed into a cell as JSON rather than flattened.
Is my data uploaded?
No. Parsing and conversion happen in the browser and disappear when you close the page.