How to use
- Paste or type JSON into the box.
- Choose an indent size.
- Click Format to beautify or Minify to compress.
- Copy or download the result.
API responses, log lines and config files often arrive as one long line of JSON that is hard to read. This JSON formatter pretty-prints it with 2 spaces, 4 spaces or tabs, or does the opposite and minifies it into a single line with all extra whitespace removed. The result replaces the input, ready to copy or download as formatted.json.
Parsing uses the browser's built-in JSON.parse, which follows the strict JSON standard (RFC 8259 / ECMA-404). That makes it a quick JSON validator too: if parsing fails you get the browser's error message, and when that message contains a character position it is converted to a line and column so you can go straight to the problem. Typical causes are trailing commas, single quotes, unquoted keys and comments.
Because the text is parsed into JavaScript values and written back out, a few details can change. Integers larger than 2^53 lose precision, if a key appears twice only the last value is kept, keys that look like non-negative integers move to the front of their object, and 1.0 is written as 1. Comments and JSON5 syntax are not accepted. Everything happens in your browser; the JSON you paste is never uploaded or stored.