DevOps

JSON Validator and Formatter

Validate, format or minify JSON with a strict parser that preserves numbers, strings and key order, and flags duplicate keys. Local calculation.

Local analysis in your browser, nothing sent. Formatting only changes whitespace: values, order and duplicates are preserved.

Input

JSON Validator and Formatter

Strict JSON (RFC 8259), up to 1,048,576 characters and 512 nesting levels. No comments or trailing commas.

Examples

Enable JavaScript for local analysis. The guide remains accessible.

Results

Enter JSON, then choose Validate, Format or Minify.

Understanding JSON validation

The tool follows strict RFC 8259 JSON: objects, arrays, double-quoted strings, numbers, true, false and null. Comments, trailing commas, single quotes, unquoted keys, NaN and Infinity are refused, with the line and column where the parser detects the error.

Format and Minify only change insignificant whitespace. Numbers are copied as written (9007199254740993, 1e1000, 1.000 or -0 are never rounded or rewritten), strings keep their escapes, and key and item order is preserved, without sorting.

Duplicate keys: RFC 8259 recommends unique names, but software handles them differently. The tool compares keys of the same object after decoding escapes (“name” and “n\u0061me” are identical), flags them and keeps every occurrence in order.

A lone surrogate \u escape (for example \ud800) is valid grammar but represents no Unicode character: it is kept as written and flagged. A raw lone surrogate, outside an escape, is refused. No Unicode normalization is applied.

Limits: 1,048,576 input characters, 512 nesting levels, 4,194,304 output characters. Analysis runs in the browser, with no upload or storage; the result is shown as plain text, never interpreted as HTML.

RFC 8259 — The JavaScript Object Notation (JSON) Data Interchange Format

Frequently asked questions

Will my large numbers be rounded?

No. The tool does not use JSON.parse and does not convert numbers: 123456789012345678901234567890 or 0.000000000000000000001 stay identical after formatting.

What happens with a duplicate key?

The JSON stays valid, but a warning gives both positions. Both values are kept; much software would keep only the last one.

Why are my comments refused?

Standard JSON does not allow them. JSONC or JSON5 accept them but are not supported here.

Back to tools home