DevTools.

JSON Formatter & Validator

Paste JSON to pretty-print it, validate it or minify it. Errors point to the exact line and column, and nothing you paste ever leaves your browser.

0 characters · Ctrl/Cmd+Enter format · Ctrl/Cmd+Shift+Enter minify

How to use

  1. Paste your JSON into the input panel, or press Sample to load an example.
  2. Choose an indentation of 2 spaces, 4 spaces or tabs.
  3. Use Format to pretty-print, or Minify to strip all insignificant whitespace.
  4. If the JSON is invalid, the error shows the line and column. Select Go to error to jump to it.
  5. Copy the result or download it as a .json file.

Example

Input

{"name":"Ada","skills":["math","code"],"active":true}

Output

{
  "name": "Ada",
  "skills": [
    "math",
    "code"
  ],
  "active": true
}

Common use cases

  • Reading a minified API response or log line.
  • Checking a config file or request body for syntax errors before committing or sending it.
  • Shrinking a JSON payload before embedding it in a script, URL or test fixture.
  • Normalizing indentation so diffs between two JSON files are readable.

Common mistakes

  • Trailing commas after the last item, which JSON does not allow.
  • Single-quoted strings or unquoted property names, which are valid JavaScript but not valid JSON.
  • Comments (// or /* */), which JSON does not support.
  • Numbers with a leading zero, such as 01, or special values such as NaN and undefined.

Frequently asked questions

Is my JSON sent to a server?

No. Parsing and formatting happen entirely in your browser. Your input is not uploaded, logged or stored.

What is the difference between formatting and validating JSON?

Validating checks that the text is syntactically valid JSON. Formatting first validates, then rewrites the text with consistent indentation. If the input is invalid, there is nothing to format, so you get an error instead.

Does formatting change my data?

Values and key order are preserved. Whitespace is normalized, and duplicate keys collapse to the last value, as in JavaScript. Numbers outside the safe integer range (beyond 9007199254740991) can lose precision because they are parsed as JavaScript numbers.

Can it handle large files?

Large inputs are processed in a background thread, so the page stays responsive. Very large files are still limited by your browser memory.