JSON Formatter & Validator
Paste any JSON to format, validate, minify, or view as a tree. Everything runs in your browser — no upload, no signup.
Input
What is JSON?
JSON (JavaScript Object Notation) is a text-based data format derived from JavaScript object syntax. It uses two structures: objects (curly braces with key-value pairs) and arrays (square brackets with comma-separated values). JSON is language-independent — every modern language can parse and generate it. It's the lingua franca of web APIs.
Common JSON errors and how to fix them
- • Trailing comma — JSON doesn't allow a comma after the last element. Remove it.
- • Single quotes — JSON requires double quotes around keys and string values. Replace them.
- • Unquoted keys — every key must be a quoted string:
{"name": "..."}, not{name: "..."}. - • Comments — JSON does not support
//or/* */comments. Remove them. - • NaN, undefined, Infinity — these are not valid JSON values. Use
nullinstead. - • Trailing data — extra text after the JSON object ends. Make sure you have only one top-level value.
JSON vs YAML vs XML
JSON is more compact than XML and easier to parse. YAML is even more compact and human-friendly but supports comments, which JSON doesn't. For machine-to-machine APIs, JSON is the default. For human-edited config files (Docker Compose, GitHub Actions, Kubernetes), YAML is more common. For legacy enterprise systems, XML still rules.
Frequently asked questions
What is JSON?
JSON (JavaScript Object Notation) is a lightweight data format for APIs, config files, and data storage. It uses key-value pairs and arrays in human-readable text. It's the standard for REST APIs and modern configuration.
Is my JSON data safe?
Yes. All processing happens in your browser. Data is never sent to any server, never logged, never stored. You can verify by checking your network tab — no requests leave your device.
What's the difference between format and minify?
Format adds whitespace and indentation for human readability. Minify removes all unnecessary whitespace for the smallest possible file. The parsed data is identical.
How do I fix "Unexpected token" errors?
Common causes: missing or extra comma, single quotes instead of double, unquoted keys, unescaped characters. The validator points to the line and column where parsing failed.
Is there a size limit?
Practical limit is 5-10 MB for smooth tree rendering. For huge files, use the text output (fast even at 50+ MB). The browser's memory cap is the real constraint.