JSON Formatter & Validator
Format, validate, explore and analyze JSON in your browser.
What is JSON?
JSON is the plain-text format most web APIs, configuration files and log pipelines use to exchange structured data. A document is built from objects ("key": value pairs in braces), arrays (ordered lists in brackets), strings in double quotes, numbers, true, false and null. This tool checks that a document follows those rules, rewrites it for reading or for compact transport, and helps you inspect, convert and query it.
How to Use the JSON Formatter & Validator
- Paste your JSON into the input box, or press Load Example to start from a sample document.
- Press Format JSON to re-indent it with 2 spaces, 4 spaces or tabs, Minify JSON to remove all optional whitespace, or Validate JSON to check the syntax without changing anything. Invalid input shows your browser's parser error so you can find the problem.
- Open Explore to browse the document as a searchable tree and copy any node's path or value, or Statistics to see counts of objects, arrays, keys and values, the maximum nesting depth and the size.
- Open Transform to convert the document to CSV, YAML, XML, TypeScript interfaces or tab-separated rows for a spreadsheet, or Advanced to run simple JSONPath/JMESPath queries, compare it with a second JSON document, or mask values that look sensitive.
Technical Notes
- Validation checks JSON syntax only — it does not check your data against a schema. Any valid JSON value is accepted at the top level, including a single number, string, true, false or null. Comments, trailing commas and single-quoted strings are not valid JSON and are reported as errors.
- Format and Minify parse your JSON into JavaScript values and write them out again, so the output is re-serialized data rather than an edited copy of your text. Some changes are only textual — for example, numbers are written in their shortest form, so 1.0 becomes 1 and 1e2 becomes 100. Others change the data itself: if an object repeats a key, only the last value is kept; numbers JavaScript cannot represent exactly may change, including integers above 9007199254740991 and high-precision decimals; and numbers too large for JavaScript, such as 1e400, become null. If exact numbers or duplicate keys matter, review the result before replacing your source data.
- The JSONPath and JMESPath queries in Advanced support only a limited subset: property access (.key), array indexes ([n]) and wildcards ([*] in JSONPath, [] in JMESPath). Filters, recursive descent (..), slices and functions are not supported, so expressions written for other tools may return nothing or a different result.
- The Data Anonymizer is pattern-based. It replaces string values that are entirely an email address, a phone number or an IPv4 address, and the values of keys whose names suggest secrets, such as password, secret, token or api_key. Because it only matches patterns, it can miss sensitive data — names, street addresses or an email inside a longer sentence, for example — so review the anonymized result before sharing it.
- CSV and the spreadsheet rows of the Excel option turn an array of objects into one row per object, or a single object into one row, with a column for every key found. Nested objects become dotted column names such as address.city, and arrays are written into a single cell as JSON text. The Excel option currently produces tab-separated text to paste into a spreadsheet, not an .xlsx file.
Frequently Asked Questions
Can formatting or minifying change my data?+
They don't intentionally edit your data, but they parse it into JavaScript values and write those values out again. A key repeated in the same object keeps only its last value, and numbers JavaScript cannot represent exactly may change: integers above 9007199254740991 (such as some 64-bit IDs) and decimals with more significant digits than JavaScript keeps are rounded, and numbers too large for JavaScript, such as 1e400, become null. If exact numbers or duplicate keys matter, review the result before replacing your source data; if you produce the JSON yourself, sending such numbers as strings avoids the problem.
What is the difference between formatting and minifying JSON?+
Formatting adds indentation and line breaks to make JSON human-readable. Minifying removes all unnecessary whitespace to compress the payload size for network transfer.
Why is my JSON invalid?+
Common causes are comments (// or /* */), a trailing comma after the last item of an object or array, keys or strings in single quotes or without quotes, line breaks or unescaped double quotes inside a string, and values JSON does not define, such as undefined or NaN. The error panel shows your browser's own parser message; its wording, and how precisely it points to the problem, varies between browsers.
Does this JSON tool send my data to a server?+
No. All JSON formatting, minification, and validation runs 100% locally in your web browser. No data is transmitted across the network.
Is JSON case-sensitive?+
Yes. Key names and literal values in JSON are case-sensitive. For example, true, false, and null must be lowercase.
