JSON Validator
Check if your JSON is valid, and instantly format or minify it — right in your browser, nothing uploaded. Errors are pinpointed by line and column, so you can fix them without hunting.
✓ Valid JSON
✗ Invalid JSON
Paste or type JSON to validate it.
Why This Tool Matters
JSON errors rarely announce themselves clearly. A build fails with "Unexpected token } in JSON" and no hint of which of three hundred lines is to blame. An API returns a response your code refuses to parse, and you need to know whether the payload is malformed or your code is. A config file gets hand-edited just before a deploy, and a single trailing comma or a missing quote is enough to take a service down. Pasting the JSON here tells you immediately whether it's valid and, if it isn't, points to the exact line and column with a hint about what's usually wrong there.
Formatting matters just as much once the JSON is valid. API responses, log entries, and stored payloads are usually minified into a single dense line that's impossible to read; beautifying it with proper indentation shows the structure at a glance. Going the other way, minifying strips out whitespace before you embed JSON in a request, an environment variable, or a URL. Unlike formatters that parse and re-serialize, this one only rearranges whitespace — so large IDs and precise numbers keep every digit, and keys stay in the order you wrote them.
How to Use
- 01
Paste your JSON
It validates live — any error shows its line and column.
- 02
Format or minify
Beautify with 2 spaces, 4 spaces, or tabs, or collapse to one line.
- 03
Copy the result
Copy the cleaned-up JSON wherever you need it.
More Text Tools
Frequently Asked Questions
What makes JSON invalid?
JSON is stricter than the JavaScript it grew out of. The most common mistakes are a trailing comma after the last item in an object or array, keys or strings wrapped in single quotes instead of double quotes, keys with no quotes at all, a missing comma between items, an unclosed brace or bracket, and comments. Values like undefined, NaN, and Infinity aren't allowed either — only strings, numbers, true, false, null, objects, and arrays.
Does this tell me exactly where the error is in my JSON?
Yes, in most cases. The validator shows the line and column of the first error, plus the offending line with a caret pointing at the problem, and adds a plain-English hint for common mistakes like trailing commas, single quotes, and unquoted keys. The exact location comes from your browser's built-in JSON parser: Chrome, Edge, and Firefox report it; some browsers, such as Safari, only describe the error, in which case the message appears without a line and column.
What's the difference between validating and formatting JSON?
Validating checks whether the text follows JSON syntax rules and can be parsed at all. Formatting (also called beautifying or pretty-printing) takes JSON that's already valid and lays it out with line breaks and consistent indentation so it's easy to read. You can't format invalid JSON, which is why this tool validates first and only shows formatted output once the input is valid.
Can I minify JSON with this tool too?
Yes. Click Minify to strip every unnecessary space and line break and collapse valid JSON onto a single compact line — useful for API requests, environment variables, or anywhere size matters. Click Format / Beautify to switch back. Both only change whitespace: key order, number precision, and string contents stay exactly as you wrote them.
Is my JSON data sent to a server when I use this?
No. Validation and formatting both run entirely in your browser using JavaScript on your own device. Nothing you paste is uploaded, logged, or stored, so it's safe to check API responses, config files, and payloads that contain credentials or personal data.
Does this support JSON5 or JSONC (JSON with comments)?
No — this tool validates strict, standard JSON only. Comments, trailing commas, single-quoted strings, and unquoted keys, which JSON5 and JSONC allow, are reported as errors here. That's deliberate for checking API payloads and files that must be standard JSON, but it means a tsconfig.json or VS Code settings file with comments will show as invalid until the comments are removed.