JSON Formatter
Paste JSON to beautify it, minify it into a single line, or check where the syntax error is. Your data never leaves your browser.
uses the browser's built-in JSON.parse, and the error message tells you the exact character position. Large files (several MB) also work, but use more memory.
When to use it
- An API response comes back as one long line and you need to see the field hierarchy and nesting.
- You want to catch a trailing comma, an unquoted key or an unescaped newline before submitting, and need the parser to point at the failing position.
When not to
- You only need one field value: searching the response in your browser devtools Network panel is faster than pasting the whole payload.
- The document is tens of MB and only needs one machine pass: jq on the command line uses less memory and avoids putting the text in a textarea.
Formatting runs entirely in your browser: the input is never uploaded and is not written to the URL or a log. Limits: it uses the native JSON.parse, so comments, single quotes and trailing commas are rejected; numbers are doubles, so integers above 2^53−1 lose precision; very large files can exhaust memory and stutter.
Frequently asked
Will a large JSON file freeze the page?
Files of a few hundred KB to a few MB usually format immediately. As the file grows, JSON.parse and JSON.stringify keep several copies in memory at once, so a file of tens of MB can stutter or fail on a device with little memory. Nothing is uploaded; a slow run only affects this tab, and a refresh clears it.
The error says position 123 — where is the actual mistake?
position is the character offset reported by the browser's JSON.parse (0-based in Chrome and Edge, which also add line and column). It marks where parsing stopped, not always the faulty character: a missing comma is often reported at the next key, and an extra trailing comma at the closing brace. Read a few lines before the reported spot. Safari and Firefox word the message and position slightly differently.
Long integer IDs change after formatting — can the precision be preserved?
No. JSON.parse converts every number to an IEEE-754 double, so integers above 2^53−1 (9,007,199,254,740,991) lose precision: 1234567890123456789 is rewritten as 1234567890123456800. That is a JSON.parse limit, not a formatting bug. Send order numbers and snowflake IDs as strings (quoted, e.g. ‘123...’) or use a BigInt-aware parser; this tool does not keep the raw number text.