SmartKitio

JSON Formatter

Paste compact or messy JSON to pretty-print it with consistent indentation, check that it parses, or minify it back to one line.

Your input stays in your browser. Nothing is uploaded.

Valid JSON
Input
Output

About this tool

The input is parsed with the browser's standard JSON parser and printed again with two-space indentation. Because the text is fully parsed, the output is normalised: extra whitespace disappears, and duplicate keys keep only their last value. Strict JSON rules apply, so comments, trailing commas, single-quoted strings, and unquoted keys are errors. Very large numbers lose precision beyond about 15–17 significant digits, because they are read as JavaScript numbers.

How to use it

  1. Paste JSON into the input panel.
  2. Choose Format to indent it, or Minify to remove whitespace.
  3. If the input is invalid, read the error message, fix the reported problem, and try again.
  4. Copy or download the result.
output = JSON.stringify(JSON.parse(input), null, 2)

When to use it

  • Reading minified API responses
  • Reviewing config files before committing
  • Spotting syntax errors in hand-written JSON

Examples

  • Compact API response

    {"id":7,"tags":["a","b"]} becomes a 7-line object with each key and array item on its own line.

  • Trailing comma

    {"a": 1,} fails with a parse error. Remove the comma after 1 and it formats normally.

  • Large IDs

    {"id": 12345678901234567890} prints as 12345678901234567000, because the number exceeds JavaScript's safe integer range. Send such IDs as strings.

FAQ

Why did formatting fail?
The text is not strict JSON. The usual causes are trailing commas, comments, single quotes, or unquoted property names.
Does it keep the key order?
Mostly. Keys are printed in the order the parser returns them. Keys that look like whole numbers, such as "1" or "42", are moved to the front in ascending order.
Can it format JSON Lines or JSON5?
No. Only a single standard JSON value is accepted. Format each line of a JSON Lines file separately.
Is my JSON uploaded?
No. Parsing and formatting happen in your browser, so API responses and config files stay on your device.