Search DevTools

Jump to any tool or page

JSON Formatter

Format, validate, minify, or convert JSON to CSV. Paste it, load it from a URL, or upload a file.

Input

paste, fetch or upload

Output

The result appears here as you type.

Data Transformation

About JSON Formatter

Paste raw JSON to reformat it with consistent indentation, minify it to the smallest transmittable size, or flatten it into CSV. Parsing runs through the browser's native JSON parser, so what you see validated here is exactly what a JavaScript runtime will accept — including its rejection of trailing commas, single-quoted keys, and unquoted identifiers that a lenient linter might let through.

Frequently asked questions

Why does my JSON fail here but work in JavaScript?
JavaScript object literals are not JSON. Literals allow single quotes, unquoted keys, trailing commas, comments, and values like undefined or NaN — strict JSON allows none of these. Keys must use double quotes, and the only permitted values are string, number, object, array, true, false, and null. If your input came from a JS file rather than an API response, this mismatch is almost always the cause.
What happens to large numbers and precision?
JSON numbers are parsed as IEEE 754 doubles, so integers beyond 2^53-1 (9007199254740991) lose precision silently. A Twitter-style 64-bit ID such as 1234567890123456789 will round to a different value on parse. APIs that emit large IDs should send them as strings; if yours does not, the formatted output will not round-trip faithfully and no formatter can recover the lost digits.
How does nested JSON convert to CSV?
CSV is flat and JSON is not, so nested objects are flattened with dot-notation keys — {"user":{"name":"Ada"}} becomes a user.name column. Arrays of primitives are serialised back to a JSON string inside the cell rather than expanded into columns, since their length varies per row. The header is the union of every key across all records, so records missing a key produce an empty cell instead of a shifted row.
Does key order change when formatting?
No. JSON.parse followed by JSON.stringify preserves the insertion order of string keys, so formatting is order-stable for ordinary payloads. The one exception is integer-like keys ({"2":"b","1":"a"}), which JavaScript objects always iterate in ascending numeric order regardless of how they were written — a quirk of the language's property ordering, not of this tool.
Is my data sent to a server?
Formatting, minifying, and validating run entirely in your browser, so pasted payloads never leave your machine. The exception is the URL-fetch option: supplying a URL routes the request through the site's server to bypass browser CORS restrictions, so do not use that path for endpoints requiring private credentials.