JSON Formatter, Validator & Minifier

Format, validate, and minify JSON in your browser. See parse errors with line/column. Optional key sorting. Nothing is uploaded.

Runs 100% in your browser — nothing is uploaded.Use this in a chain
79 bytes
Result
130 bytes(+65%)

How to use

  1. 1
    Paste your JSON

    Drop any valid JSON into the input box — an object, an array, or a single value.

  2. 2
    Pick an indent

    Choose 2 or 4 spaces, or tab. Pick "minified" to strip whitespace instead.

  3. 3
    Read the result

    The output updates as you type. Errors show the exact line and column so you can fix them fast.

  4. 4
    Copy or share

    Copy the formatted output, or share the URL — your input is preserved in the address bar.

Examples

Prettify a minified blob
Input
{"name":"ToolVaults","tools":104,"private":true}
Output
{
  "name": "ToolVaults",
  "tools": 104,
  "private": true
}
Default 2-space indent. Great for reading API responses.
Sort keys for diffing
Input
{"b":2,"a":1,"c":3}
Output
{
  "a": 1,
  "b": 2,
  "c": 3
}
Two payloads with the same content but different key order will now diff as identical.
Catch a trailing-comma error
Input
{
  "a": 1,
  "b": 2,
}
Output
Error at line 4, column 1: Unexpected token }
JSON forbids trailing commas — the error points to the offending line.

Frequently asked

Is my JSON uploaded anywhere?

No. Formatting and validation happen entirely in your browser using the native JavaScript engine. Your data never leaves the device.

Why does the parser say "unexpected token"?

JSON is stricter than JavaScript: keys must be double-quoted strings, no trailing commas, no comments. The error message shows the exact line and column where parsing failed.

What is "sort keys" for?

It reorders object keys alphabetically at every nesting level. Handy for diffing two JSON blobs that have the same content but different key order.

Related tools