How to Format and Validate JSON Online — Instantly Fix Broken JSON
Minified or broken JSON is nearly impossible to read. Learn how to format it into clean, human-readable code and validate it against the JSON spec in one click.
Open JSON Formatter
Perform this task online in seconds with zero sign-up or watermarks.
Format JSON in One Step
Follow these simple step-by-step instructions:
Paste your JSON
Paste raw, minified, or broken JSON into the editor. The formatter accepts JSON objects {}, arrays [], strings, numbers, and booleans.
Click Format (or validate first)
Click 'Format JSON' to immediately prettify the output with proper indentation. Click 'Validate' to check for syntax errors without modifying the structure.
Copy or download the result
Copy the formatted JSON to your clipboard or download it as a .json file. Use the 'Minify' button to do the reverse — compress formatted JSON back to a compact single line.
Common JSON Syntax Errors and How to Fix Them
JSON has strict syntax rules. Here are the most common errors developers encounter and how to fix them:
- Trailing commas after last property: { "a": 1, } → Remove the trailing comma
- Single quotes instead of double quotes: { 'key': 'value' } → Use double quotes
- Unquoted property names: { key: "value" } → Always quote property names
- Comments (// or /* */): Not allowed in JSON — remove all comments
- Missing commas between properties: { "a": 1 "b": 2 } → Add comma after each property
JSON vs JSONC vs JSON5: What's the Difference?
Standard JSON (RFC 8259) is very strict: no comments, no trailing commas, no single quotes. This is what APIs and most programming language parsers expect.
JSONC (JSON with Comments) is used in VS Code config files (settings.json, tsconfig.json). It allows // comments but still requires double quotes.
JSON5 is a superset of JSON used in some configuration tools. It allows comments, trailing commas, and single quotes — but most APIs do not accept it.
Ready to Get Started?
Try our tool right in your browser. Fast, secure, and 100% free.
Open JSON FormatterFrequently Asked Questions
Related Guides & Tutorials
Related Tools
Explore other popular free tools in this category.
Case Converter
Convert text between UPPERCASE, lowercase, camelCase, snake_case
Word Counter
Count words, characters, sentences, paragraphs and reading time
Lorem Ipsum Generator
Generate placeholder text and paragraphs
Regex Tester
Test and debug regular expressions with live highlights