Free tool

JSON formatter and validator

Paste JSON to format it neatly, minify it or check that it is valid. Errors are reported with the line and column, and your data never leaves your browser.

  • Format and minify
  • Errors with line and column
  • Data stays on your device

Paste JSON and press Format (or Ctrl or Cmd + Enter).

Free, with no sign-up. The tool runs entirely in your browser: nothing you enter is uploaded or stored on our servers.

How to use it

How it works

  1. 01

    Paste your JSON

    From an API response, a config file or a log.

  2. 02

    Format or minify

    Choose indentation and optionally sort keys.

  3. 03

    Fix and copy

    Fix any error at the reported position, then copy the result.

What JSON is

JSON (JavaScript Object Notation) is a text format for structured data, used by most web APIs, configuration files and many databases. It is made of objects in curly braces, arrays in square brackets, and values: strings in double quotes, numbers, true, false and null.

Common JSON errors

  • Trailing commas after the last item in an object or array.
  • Single quotes instead of double quotes around strings or keys.
  • Keys without quotes, which are valid JavaScript but not valid JSON.
  • Comments, which JSON does not allow.
  • Values JSON does not support, such as NaN, Infinity or undefined.
  • Unescaped characters inside strings, such as line breaks or a double quote without a backslash.

The validator shows where parsing stopped. The real mistake is often just before that point, such as a missing comma at the end of the previous line.

Formatting versus minifying

Formatting adds line breaks and indentation so people can read and compare data. Minifying removes all unnecessary whitespace, which makes files and API payloads smaller. The data is identical either way. Sorting keys alphabetically makes two versions of the same object easier to compare.

Keep sensitive data local

API responses often contain personal data, tokens or internal details. This tool parses and formats JSON entirely in your browser, so nothing is uploaded. Even so, remove secrets such as API keys before sharing formatted output with others.

Questions, answered

No. Parsing and formatting happen in your browser with its built-in JSON engine.

Some tools accept relaxed formats such as JSON5 or JavaScript objects with comments and single quotes. Standard JSON is stricter.

Files of several megabytes usually work. Very large files depend on your device's memory and may be slow.

By the Stegnor team · Updated