Developer Tools
JSON Formatter & Validator
Paste or upload JSON to instantly validate it, beautify it with your choice of indentation, minify it, and explore it as a collapsible, syntax-highlighted tree. Invalid JSON gets a precise line and column number plus a plain-English explanation of what's wrong, not just a raw parser error. Everything runs locally in your browser; nothing you paste here is ever uploaded.
What is JSON?
JSON (JavaScript Object Notation) is a lightweight, text-based format for representing structured data as nested key-value pairs and ordered lists. It was popularized by JavaScript but is completely language-independent (every mainstream programming language can read and write it), which is why it became the de facto standard for web APIs, configuration files, and data interchange between systems that otherwise share nothing.
A JSON document is built from just six data types: objects ({ }, unordered sets of key-value pairs), arrays ([ ], ordered lists), strings, numbers, booleans (true/false), and null. That small, strict surface area is precisely what makes JSON easy to parse reliably and hard to write ambiguously, but it also means JSON is stricter than the JavaScript object literals it resembles, which is where most validation errors come from.
You'll run into JSON constantly as a developer: REST and GraphQL API responses, package.jsonand tsconfig.json config files, structured application logs, NoSQL document stores like MongoDB, webhook payloads, and infrastructure-as-code templates all use it as their native format.
Why validate and format JSON?
Minified or hand-edited JSON is fast for machines and painful for people. Validating and formatting it turns a wall of unreadable text into something you can actually reason about, and catches problems before they cause a failure somewhere less convenient than your own screen.
- Debugging broken API calls: when a request fails or a response looks wrong, a formatted, validated view makes it obvious which field is missing, misspelled, or the wrong type.
- Catching config errors early: a single stray comma in a config file can crash a build; validating it before committing catches that instantly instead of after a failed deploy.
- Reading minified payloads: logs, network tab responses, and compressed API output are often a single unreadable line; formatting restores structure so you can actually read it.
- Reducing payload size: minifying formatted JSON before sending it strips whitespace you don't need over the wire.
- Sanity-checking hand-written data: sample payloads, fixtures, and seed data are easy to get subtly wrong by hand; validation catches that before it causes a confusing test failure.
Common JSON errors and how to fix them
Most invalid JSON comes from a small, recurring set of mistakes, usually because JSON looks almost identical to a JavaScript object literal but is stricter. Here are the ones this tool sees most:
- Trailing commas
{ "a": 1, "b": 2, }Remove the comma after the last item in an object or array. Unlike JavaScript, strict JSON doesn't allow one.
- Unquoted keys
{ name: "Alice" }Wrap every object key in double quotes: { "name": "Alice" }. Bare identifiers are valid JavaScript but not valid JSON.
- Single quotes
{ 'name': 'Alice' }JSON strings and keys must use double quotes only: { "name": "Alice" }.
- Comments
{ "name": "Alice" // a comment }The JSON spec has no concept of comments, in any form. Delete them, or move that context into a real field like "_note".
- Undefined, NaN, or functions
{ "score": NaN, "cb": function(){} }These are JavaScript-only values. JSON only supports strings, numbers, true/false, null, objects, and arrays.
- Leading zeros or a stray decimal point
{ "id": 007, "rate": .5 }Numbers can't start with a leading zero or a bare ".". Use 7 and 0.5, or quote the value as a string if it's really an identifier.
- A missing comma or bracket
{ "a": 1 "b": 2 }Every value except the last in an object or array needs a comma after it, and every { [ needs a matching } ]. This tool points at the exact line and column so you don't have to eyeball it.
How to use this tool
- Paste your JSON into the input box, upload a .json file, drag one onto the input, or click "Load example" to try it instantly.
- Invalid JSON is flagged as you type, with the exact line, column, and a plain-English explanation.
- Choose 2-space, 4-space, or tab indentation, or toggle Minify to collapse everything to one line.
- Optionally sort object keys alphabetically for easier diffing and comparison.
- Switch to the Tree view to explore nested data with collapsible, syntax-highlighted nodes.
- Copy the formatted result to your clipboard or download it as a .json file.
Frequently asked questions
Need something more custom than a free tool?
If a ready-made utility won't cut it, our engineering team builds custom software, APIs, and data pipelines too.

