JSON Formatter & Validator

Format, minify and validate JSON with precise error positions, so you can find the exact character where parsing failed.

Runs entirely in your browser. Your input is never sent to our servers.

Paste JSON to validate and format it.

What is JSON Formatter & Validator?

JSON (JavaScript Object Notation) is a text format for structured data built from objects, arrays, strings, numbers, booleans and null, defined by RFC 8259.

What this JSON Formatter & Validator does

Parses JSON, reports whether it is valid, and reformats it with the indentation you choose or minifies it to a single line. When parsing fails it converts the parser’s character offset into a line and column, so you can go straight to the problem instead of counting characters.

Valid documents also get a structural summary: root type, total key count, maximum nesting depth, and the size difference between formatted and minified output.

How to use it

  1. Paste JSON into the input.
  2. Choose an indent width, or Minified to strip all whitespace.
  3. If it is invalid, read the line and column and fix the character it points at.

Understanding your results

Max nesting depth matters when a consumer imposes a limit, and deep nesting is often a sign that a flatter shape would serve better.

Minified size is what actually travels over the wire. Formatting is for humans; APIs should send minified JSON and let clients pretty-print.

Why this matters

JSON is the default interchange format for HTTP APIs, configuration files, log pipelines and infrastructure tooling. A single misplaced comma stops a deployment, and parser messages are often unhelpful on their own — a precise line and column turns a hunt into a fix.

Common mistakes

Trailing commas. JavaScript object literals allow them; JSON does not. {"a":1,} is invalid.

Single quotes. JSON strings require double quotes. {'a':1} is invalid.

Unquoted keys. Every key must be a quoted string, so {a:1} is invalid even though it is valid JavaScript.

Comments. JSON has none. Formats like JSONC and JSON5 add them, but standard parsers reject them.

Large integers. JSON numbers have no size limit, but JavaScript parses them as IEEE-754 doubles, so integers above 253 − 1 lose precision silently. Transmit them as strings.

Technical background

Standardised as RFC 8259 and ECMA-404. The grammar is deliberately small: six value types and no extensions. That minimalism is why JSON parsers exist for practically every language, and also why it lacks comments, dates and integer/float distinction — all things applications must layer on top by convention.

Limitations

Formatting and validation only; there is no schema validation, JSONPath querying or diffing. Extremely large documents are limited by your browser’s available memory, since everything is parsed locally.

Frequently asked questions

Why is my JSON invalid when it looks fine?

The usual causes are a trailing comma, single quotes instead of double quotes, an unquoted key, or a comment. The reported line and column point at the first character the parser could not accept.

Does JSON support comments?

No. Standard JSON has no comment syntax. JSON5 and JSONC add it, but a standard parser will reject those files.

Why did my large number change?

JavaScript parses JSON numbers as IEEE-754 doubles. Integers larger than 9007199254740991 cannot be represented exactly and are rounded. Send such values as strings.

Is my JSON uploaded anywhere?

No. Parsing and formatting happen entirely in your browser, which matters when the document contains production data.

References

Last reviewed