Skip to content

JSON formatter and validator — free, in your browser

Free · no sign-up · runs in your browser

Format, minify and validate JSON in your browser. Broken documents get the exact line and column of the error. Nothing is uploaded, and there is no size limit but your machine.

Parsed as you type. Nothing is uploaded.

Alphabetical, at every depth. Arrays keep their order.

Result

{
  "id": 42,
  "name": "Acme",
  "active": true,
  "tags": [
    "design",
    "tools"
  ],
  "owner": {
    "id": 1,
    "email": null
  },
  "members": [
    {
      "id": 2,
      "email": "kim@example.com",
      "profile": {
        "avatar": "a.png"
      }
    },
    {
      "id": 3,
      "email": null
    }
  ]
}

14 keys · 5 objects · 2 arrays · depth 4 · 324 characters

Parsed and formatted in this page by the browser's own JSON engine. Nothing is uploaded — check your network tab.

Paste JSON and get it back readable, minified, or with its keys sorted. If it will not parse, this tells you the line and column where it broke instead of just saying "invalid JSON" — which is the part that actually costs you time. Everything runs in this tab: the document never leaves your machine, which matters more for JSON than for most formats, because the JSON people need to format is usually an API response with somebody's data in it.

How it works

  1. 01Paste or type JSON into the input. It is parsed as you type, so you see the result immediately.
  2. 02Pick an indent: two spaces, four spaces, tabs, or minified for a single line with no whitespace.
  3. 03Turn on "sort keys" to order every object's properties alphabetically, at every depth. Arrays keep their order — their order is data, not formatting.
  4. 04If the document will not parse, the error appears with the line and column, so you can go straight to it rather than hunting for the missing comma.
  5. 05The stats under the output count keys, objects, arrays and nesting depth, which is the quickest way to see whether a payload is shaped the way you expected.
  6. 06Copy the result, or clear and start again.

Use cases

  • Making a minified API response readable so you can actually find the field you need.
  • Checking that a config file parses before committing it and waiting on a failed build to tell you.
  • Minifying JSON before pasting it into an environment variable or a query string.
  • Sorting keys on two versions of the same payload so a diff shows real changes instead of reordering.
  • Formatting a response that contains customer data, without pasting it into a website that keeps it.
  • Finding the exact position of a syntax error in a large document your editor renders as one long line.

Frequently asked questions

Is my JSON uploaded anywhere?

No. Parsing and formatting happen in this page using the browser's own JSON engine. There is no request to any server, which you can confirm in your browser's network tab, or by disconnecting from the network after the page has loaded. That is the main reason to prefer a client-side formatter: the JSON worth formatting is usually a real API response, and most online formatters post it to a backend.

Why does my JSON with comments fail?

Because comments are not JSON. The format has no comment syntax — what you have is probably JSONC or JSON5, which editors and config files accept but parsers do not. The same applies to trailing commas, single-quoted strings and unquoted keys. Strip those and it will parse. This tool deliberately does not accept them: a formatter that silently accepted invalid JSON would hand you a document your production parser then rejects.

Does formatting change my data?

The values do not change, but the text can. The document is parsed and re-serialised, which is the only way to guarantee valid output — so escapes are normalised, numbers are re-rendered in their shortest round-trip form (1.0 becomes 1, 1e3 becomes 1000), and duplicate keys collapse to the last one. Key order is preserved unless you ask for sorting. If you need the original bytes untouched, a formatter is the wrong tool.

Is there a size limit?

Only your machine's memory. There is no server-side cap because there is no server, but very large documents (tens of megabytes) will make the browser tab sluggish while it parses and re-renders — the work happens on the main thread. For a file that big, a command-line tool like jq is a better fit.

What do the numbers under the output mean?

Keys counts every object property at every depth; objects and arrays count how many of each the document contains; depth is how deeply nested it is, where a flat object is 1. They are quick sanity checks — an unexpected depth usually means a payload is wrapped in something you did not expect, and a key count far from what you assumed usually means you are looking at a page of results rather than a single record.

Why does sorting keys not sort my arrays?

Because an array's order is part of its meaning. Sorting the properties of an object changes only presentation — JSON objects are unordered by specification — while reordering an array changes the data. Sorting keys is intended for diffing two payloads that list the same fields in different orders; doing the same to arrays would produce a diff that looks clean while describing a document you do not have.

Related reading

More tools