JSON Formatter & Validator
Runs locallyFormat, validate, minify, repair, sort keys and query JSON with Tree and Table views.
What is JSON Formatter & Validator?
Format, validate, minify, sort keys, and repair JSON directly in your browser. Inspect nested payloads with interactive Tree and Table views, run JSONPath queries, validate against JSON Schema (drafts 07 and 2020-12), and preserve BigInt precision without ever uploading your data.
How to use JSON Formatter & Validator
- Step 1
Paste JSON, JSON5, JSONC, or NDJSON into the editor or drop a file from disk.
- Step 2
Choose your mode (Format, Minify, Validate, Sort keys, Repair, Escape, or Stringify) and indentation in Options.
- Step 3
Switch between Code, Tree, and Table views or run a JSONPath filter to inspect large payloads.
- Step 4
If syntax errors appear in the Problems panel, click a diagnostic to jump to the exact line and column or click Auto-fix.
- Step 5
Copy, download as .json, or send the formatted output directly into JSON to TypeScript or JSON Diff.
Features
- Strict JSON, JSON5, JSONC (comments), and NDJSON/JSON Lines parser modes
- Auto-fix (jsonrepair) for trailing commas, single quotes, unquoted keys, and Python literals with a change summary
- BigInt-safe number precision preservation above 2^53 and duplicate-key warnings
- Interactive Tree view (expand/collapse to depth N, copy path/value) and sortable Table view with CSV export
- JSONPath query search and JSON Schema (AJV) validation + schema generation from sample
- Web Worker execution for multi-megabyte payloads with progress and cancellation
Example
Input
{'status':'ok','users':[{'id':9007199254740993,'name':'Ada',}],}Output
{
"status": "ok",
"users": [
{
"id": 9007199254740993,
"name": "Ada"
}
]
}Auto-fix repairs single quotes and trailing commas while preserving the 64-bit integer without rounding.
Frequently asked questions
What is a JSON formatter?
It re-indents JSON so it is readable, checks that it is valid and can also minify it for smaller payloads.
Is my JSON uploaded anywhere?
No. Formatting and validation run in your browser. Nothing is sent to a server.
How do I fix invalid JSON?
Use Auto-fix. It repairs common problems such as trailing commas, single quotes, unquoted keys, comments and truncated input, and shows you exactly what it changed.
What is the difference between format and minify?
Format adds whitespace for humans. Minify removes it to reduce size.
How large a file can I format?
It runs in a background worker, so large files work, but the practical limit depends on your device memory. If a file is huge, use Table or Tree view and search instead of the full text view.
Related tools
JSON to TypeScript Converter
Generate TypeScript interfaces, types, Zod schemas, Kotlin, Swift, Dart and Go models.
JSON to YAML Converter
Convert JSON to YAML and back with indent, flow style, key sorting and lossy warnings.
JSON to CSV Converter
Convert JSON object arrays to CSV/TSV with nested flattening, delimiter and BOM options.