Developer Tools

JSON Formatter and Validator

Validate JSON syntax, format or minify it while preserving number notation, string escapes and duplicate keys. Preview your input and inspect its structure in your browser.

About JSON Formatter and Validator

Validate and format JSON without rewriting values

Check JSON syntax against RFC 8259, format it with 2 spaces, 4 spaces or tabs, or minify it by removing whitespace outside strings. This tool keeps number notation, string escapes, key order and duplicate keys. It does not convert numbers to JavaScript Number values, so values such as 9007199254740993, 1e400 and -0 keep their original spelling.

Valid syntax does not guarantee that another application will interpret every value as intended. Duplicate keys and numbers outside a receiving application's supported range can cause interoperability problems.

How to use the preview and structure view

Paste your JSON into the input. Validation runs as you edit. Choose an indentation option and select Format, or select Minify for compact JSON. Both actions update the input. Preview shows the current input exactly as displayed in the editor.

For example, {"name":"Alex","active":true,"items":[1,2,3]} has 3 keys, 7 value nodes and a maximum depth of 2. Structure shows the root and its top-level entries, 100 per page. Each entry shows its JSON type and value, or the number of immediate children. Nested objects and arrays are summarized rather than expanded into a full tree.

The root has depth 0. Each step into an object value or array item adds 1. Node count includes the root and every value at every level. Key count counts all object name/value pairs, including duplicate names. A string, number, boolean or null can also be the root.

Size limits and error recovery

Input and formatted output are limited to 100,000 UTF-16 code units, a maximum depth of 64 and 10,000 value nodes. These are limits of this tool, not universal JSON limits. Most basic Latin characters use one code unit; many emoji use two, and a displayed character can contain several code points.

Syntax errors show a line, column and position from the start, all starting at 1. Columns and positions count UTF-16 code units. A byte order mark (BOM) is not accepted. If formatting would exceed the output limit, the original input is kept. Edit the input to revalidate it. Clear empties the input while keeping your indentation and view settings.

JSON syntax rules

Property names and strings need double quotes. Comments, trailing commas, single-quoted strings, integers with leading zeros, NaN and Infinity are not JSON. Whitespace outside strings is limited to spaces, tabs, carriage returns and line feeds. Objects, arrays, strings, numbers, true, false and null are all accepted at the root. JSON5 and JSONC extensions are not supported.

Copying and privacy

Copy copies the current valid input. If browser support or permissions prevent copying, use Select input and copy manually. If completion has not been confirmed after about 5 seconds, a notice explains the pending state. Browser timers may run later in background tabs. An unfinished native clipboard write cannot be canceled, so another copy is blocked until it finishes or you reload the page. Editing the input suppresses stale completion notices. Changing only the view or indentation setting does not change the text being copied.

JSON processing takes place in your browser. Site analytics and advertising make separate network requests. Do not enter confidential information.

Frequently asked questions

Q. Will formatting round large integers or decimals?
No. Format and Minify preserve the original number notation, including 9007199254740993, 1e400 and -0. Another application may round or reject a value when it reads the JSON.
Q. What happens to duplicate keys?
They remain in their original order and count separately in statistics and the structure view. Other software may keep only one of the values, so avoid duplicate names when exchanging data.
Q. What is the maximum JSON size?
Input and formatted output may contain up to 100,000 UTF-16 code units, with a maximum depth of 64 (root = 0) and 10,000 value nodes. If formatting would exceed the output limit, your input stays unchanged.
Q. Does this support JSON5, JSONC or JSON Schema validation?
It checks RFC 8259 JSON syntax. JSON5 and JSONC extensions such as comments and trailing commas are not supported. BOMs and non-JSON whitespace are rejected. It does not validate data against a JSON Schema or your application's business rules.
Q. Is my JSON sent to a server for processing?
JSON processing happens in your browser. Site analytics and advertising make separate network requests. Do not enter confidential information.

Sources and specifications

Related tools

Questions or feedback? Contact NanToo

Rate this tool
5.0(1 ratings)