Skip to main content

JSON Formatter & Validator

Pretty-print, minify and validate JSON, with clear error locations. Everything runs in your browser, so your input isn’t uploaded.

How to use the JSON Formatter & Validator

  1. Paste your JSON into the input box, or select Load sample.
  2. Choose Format to indent it, Minify to remove whitespace, or Validate to only check it.
  3. Fix any error shown, using the line and column as a guide, then copy or download the result.

Example

Paste compact JSON, choose Format with 2 spaces of indent, and it becomes easy to read. A common mistake is a trailing comma, as in {"a": 1,}. Validate points to where the parser stopped.

Input
{"name":"Vexiqora","free":true,"tools":["json","diff","base64"]}
Formatted output
{
  "name": "Vexiqora",
  "free": true,
  "tools": [
    "json",
    "diff",
    "base64"
  ]
}

About this tool

JSON is the text format most web APIs and config files use. This tool reads your JSON, checks that it is valid, and rewrites it either with neat indentation (easier for people to read) or with all extra whitespace removed (smaller to send over a network).

Good to know

  • Your JSON is parsed as data and never run as code.
  • Browsers read JSON numbers as floating-point values, so integers larger than 9,007,199,254,740,991 can lose precision.
  • Error wording and positions come from your browser, so they can differ slightly between Chrome, Firefox and Safari.

Related tools

Browse all tools