JSON validator, formatter and repair
Paste JSON to find the exact line of every error, with a plain-English fix, or repair it in one click. Beautify, minify, check it against a JSON Schema, compare two documents, or validate a whole folder of files at once. Everything runs in your browser.
JSON Schema optional: also check that the data has the right shape On
Drop JSON files or a whole folder here
Every file is checked in your browser, nothing is uploaded. From folders it picks up .json, .geojson, .har, .map and .webmanifest files, and skips node_modules and hidden folders.
How to validate and format JSON
- Paste your JSON into the editor, open a file, or drag one in.
- Press Validate (or Ctrl/Cmd + Enter). If something is wrong, you get the line and column, what was expected, and how to fix it. Go to error jumps right there.
- Beautify to indent it with 2 spaces, 4 spaces or tabs, or Minify to strip every optional space. Then copy it.
Repair broken JSON
Press Repair to turn "almost JSON" into valid JSON in one click, and see exactly what changed. It removes trailing commas and comments, swaps single and curly quotes for double quotes, quotes unquoted keys, turns True, None, NaN and undefined into JSON values, fixes numbers like .5, +1 and 0x1F, escapes line breaks inside strings, adds missing commas, colons and closing brackets, and strips Markdown code fences and JSONP wrappers. JSON that was saved as a string, like "{\"a\":1}", is unwrapped. Undo with Ctrl/Cmd + Z.
Validate JSON against a schema
Open JSON Schema and paste a schema (draft 4, 7, 2019-09 or 2020-12). Validate then checks the shape of your data too: required properties, types, formats like email and date-time, enums, ranges and patterns. Each problem shows its JSON path and jumps to the exact line. It works in Bulk validate as well, so you can check a whole folder of files against one schema.
Compare two JSON documents
Open Compare and paste two versions, like an API response before and after a change, two config files, or expected and actual test output. The diff is by meaning, not by text: key order, spacing and formatting never count, 1 equals 1.0, and "\u00e9" equals "é". You get a list of added, removed and changed values with their JSON paths, each linked to its line. Turn on Ignore array order when lists are sets.
Validate many JSON files at once
Open Bulk validate and drop in a batch of files or a whole folder, like fixtures, translations, configs or an API dump. Each file gets a pass or fail with the line, column and fix for the first error, plus warnings like duplicate keys. Click a file to open it in the editor at the error, and copy a plain-text report to share. Thousands of files work, checked in the background in your browser.
Errors it explains
navaja json follows the JSON standard (RFC 8259) strictly, and spots the mistakes people actually make:
- Trailing commas after the last item, like
[1, 2,]. - Single quotes and unquoted keys, like
{'a': 1}or{a: 1}, which are JavaScript, not JSON. - Missing commas between properties or items.
- Comments, which JSON doesn't allow.
- Python and JavaScript values like
True,None,NaNorundefined. - Invalid numbers: leading zeros, hex,
.5,1., a leading plus. - Broken strings: a missing closing quote, a real line break or tab inside a string, a bad escape like
\x. - Invisible characters pasted from web pages, like non-breaking spaces, and curly quotes from documents.
- Mismatched brackets: a
]closing an object, or a bracket that is never closed.
It also warns about valid JSON that will likely bite you later: duplicate keys, where most parsers silently keep only the last value, and numbers too large for JavaScript, which JSON.parse would round. Formatting here never changes your numbers.
Questions
Is my JSON sent to a server?
No. Validation and formatting run entirely in your browser. Nothing you paste or open is uploaded or stored, so it is safe for API responses, configs and data with secrets in it.
Why does my JSON fail with a trailing comma?
The JSON standard doesn't allow a comma after the last item of an object or array, even though JavaScript does. Remove the comma before the closing } or ].
Can JSON have comments?
No. Plain JSON has no comments. Formats like JSON5 and JSONC (used by VS Code settings) allow them, but a strict JSON parser will reject them.
Will formatting change my numbers?
No. navaja json keeps every number exactly as written, including long IDs like 12345678901234567890 that JavaScript's JSON.parse would round, and it warns you when a number is too large for JavaScript.
What is the difference between beautify and minify?
Beautify adds line breaks and indentation so JSON is easy to read. Minify removes all optional whitespace so it is as small as possible for sending over the network. Both keep the data the same.
Does it detect duplicate keys?
Yes. Duplicate keys are technically allowed by the grammar, but most parsers keep only the last value, so navaja json shows a warning with the line of each duplicate.
Can I validate multiple JSON files at once?
Yes. Switch to Bulk validate and drop in many files or a whole folder. Every file is checked in your browser, and you get a list of which ones are invalid, with the line and column of each error.
Can it fix my JSON automatically?
Yes. Repair fixes the common mistakes (trailing commas, single quotes, comments, unquoted keys, Python values like True and None, missing commas and brackets) and lists every change it made. If it can't make the text valid, it changes nothing.
Does it support JSON Schema?
Yes, drafts 4, 7, 2019-09 and 2020-12, for one document or a whole folder of files. Schemas are checked in your browser; remote $ref links are not fetched, so paste a self-contained schema.
How do I compare two JSON files and ignore key order?
Use the Compare tab. It parses both documents and compares values, so property order, whitespace and number formatting (1 vs 1.0) never show up as differences. Arrays are compared by position unless you tick Ignore array order.
How big a file can I check?
Files of tens of megabytes work, limited only by your browser's memory. A 14 MB file validates and formats in under two seconds on a typical laptop.