JSON Formatter & Validator
Paste raw or minified JSON to validate it and pretty-print it with 2 or 4 spaces of indentation. Switch to minify to compact it onto one line. If the JSON is not valid, the tool names the first problem in plain words with its line and column, for example a trailing comma, a single-quoted string or a missing comma. Only the white space changes: numbers, strings and the order of keys stay exactly as you wrote them. Everything runs locally in your browser.
Related Tools
[8 suggestions]JSON Compare: Find the Differences Between Two JSON Files
Compare two JSON documents by their data and list every added, removed and changed value with its path, ignoring spacing and key order.
Developer & WebBase64 Encoder / Decoder
Easily encode plain text to Base64 format or decode Base64 back to readable text.
Developer & WebURL Encoder / Decoder
Encode URI components or decode percent-encoded URLs safely and reliably.
Developer & WebRegex Tester
Test regular expressions against a string, highlight matches, and inspect capture groups.
Developer & WebSQL Formatter and Beautifier
Format and beautify SQL queries with one clause per line, keyword case and indent options, for PostgreSQL, MySQL, SQLite, SQL Server and more.
Developer & WebJSON to TypeScript Converter
Paste JSON and get TypeScript interfaces or types, with optional keys, unions and nested types worked out from your sample.
Developer & WebXML Formatter and Validator
Format, minify and validate XML. Errors show the line and column, and the text inside your elements is never changed.
Developer & WebCode to Image Generator
Turn a code snippet into a shareable image with syntax colors, a window bar, line numbers and a gradient backdrop, as a PNG, JPEG, WebP or SVG.
Developer & WebGuides for the JSON Formatter
- Core Web Vitals on a Static Next.js Site: What We Measured
Core Web Vitals are LCP, INP and CLS. We measured 90 page loads of our static Next.js site on desktop and a throttled phone. Here are the numbers and limits. (November 30, 2026)
- Breadcrumb Structured Data: Example, Rules and an Audit
Breadcrumb structured data needs two items and a clear position. We audited the 116 pages that carry it, with a copy-paste example and Google's rules. (November 28, 2026)
- FAQ Schema in 2026: Is FAQPage Markup Still Worth Adding?
FAQ schema no longer earns a rich result in Google. We checked 102 of our own pages and what Google says to do with the markup you already have. (November 27, 2026)
- How to Format XML and Fix Well-Formedness Errors
Learn how to format XML and fix well-formedness errors: unclosed tags, nbsp, bad attributes. Tested against libxml2 on 42,145 documents. (November 15, 2026)
About the JSON Formatter & Validator
The JSON Formatter checks your text against the JSON grammar (RFC 8259) and re-indents it by changing only the white space between tokens. A common shortcut is JSON.parse() followed by JSON.stringify(), but that rewrites the data: a number such as 12345678901234567890 becomes 12345678901234567000, 1.50 becomes 1.5, keys that look like integers move to the front, and when a key appears twice only the last value survives. This tool leaves all of that alone, and it warns you about repeated keys and about numbers a JavaScript program would round. Its validator accepts exactly the text that JSON.parse() accepts (we compared them on 40,000 damaged documents), but the message does not depend on your browser: it explains what is wrong, such as a trailing comma, single quotes, an unquoted key, a comment, NaN, a leading zero or a line break inside a string, and gives the line and column. Minify mode removes every unnecessary space and line break, which is useful before embedding JSON in an API request or an environment variable.
Why does my JSON fail to parse?▾
JSON has strict rules: property names and strings need double quotes, a comma cannot follow the last item, and comments, NaN and undefined are not allowed. The tool shows the first problem with its line and column and says how to fix it.
What is the difference between pretty-print and minify?▾
Pretty-print adds line breaks and 2 or 4 spaces of indentation so the structure is easy to read. Minify removes all unnecessary white space to produce the smallest valid text, which is useful for API requests and storage. Neither changes the data.
Does this support JSON with comments (JSONC)?▾
No. Standard JSON does not allow comments, and the tool will point at the first comment it finds. If you have JSONC, as in tsconfig.json, remove the comments before pasting.
Does formatting change my numbers or key order?▾
No. Many formatters parse the JSON and write it back, which rounds large numbers and reorders keys that look like integers. This tool only changes white space, so 12345678901234567890 and 1.50 stay as written.
What happens if a key appears twice?▾
The text is valid JSON, and the tool keeps both keys and shows a warning. Most programs keep only the last value, so the first one is silently lost when the data is read.