JSON Formatter

Pretty-print, validate or minify JSON.

Frequently asked questions

What does the JSON formatter do?

It pretty-prints JSON with indentation, minifies it to the smallest valid form, or validates it and reports the exact syntax error.

Why is my JSON invalid?

Common causes are trailing commas, single quotes instead of double quotes, unquoted keys and missing brackets. The validator points to the error.

Is my JSON uploaded anywhere?

It is processed on our server over HTTPS and nothing is stored. For confidential data, use an offline editor.

What is the difference between JSON and JSON5?

Standard JSON is strict, with double-quoted keys, no comments and no trailing commas. JSON5 is a relaxed superset that allows those conveniences for hand-editing, but it is not understood by standard JSON parsers.

Why can JSON not contain comments?

The JSON specification deliberately omits comments to keep the format simple and unambiguous for data interchange. If you need annotations, add a field for them or use a format like YAML that supports comments.

How are special characters escaped in JSON strings?

JSON strings escape a small set of characters with a backslash, including the double quote, backslash and control characters, and allow a Unicode escape of a backslash-u followed by four hex digits for any character.

What is the maximum safe number in JSON?

JSON numbers are commonly parsed as double-precision floats, so integers beyond about 9 quadrillion lose precision. Represent very large integer identifiers as strings to avoid silent rounding.