JSON Formatter & Validator
Paste JSON to validate, format or minify it. Errors show the line and column, and numbers and strings are kept exactly as written. Everything runs in your browser.
Output
FAQ
What does the validator check?
It checks strict JSON syntax (RFC 8259) and shows the line and column of the first error. Typical mistakes such as single quotes, trailing commas, comments, NaN or True are explained in the message.
Can formatting change my data?
No. Numbers and strings are copied exactly as written, so large integers like 12345678901234567890, 1.0 or escaped characters such as \u00e9 stay the same. Only whitespace changes.
Why use Minify?
Minify removes all whitespace outside strings, which makes JSON smaller for API payloads or storage. Use Format when you need to read or review it.
Are JSON5 or JSONC (comments, trailing commas) supported?
No. Only standard JSON is accepted. Comments and trailing commas are reported as errors so you can remove them.
Related tools
What Is JSON?
JSON (JavaScript Object Notation) is a lightweight data interchange format that is easy for humans to read and write and easy for machines to parse and generate. It is the most widely used format for APIs, configuration files, and data storage across web applications, mobile apps, and backend services.
Why Format JSON?
Raw JSON from APIs or logs is often minified into a single line, making it nearly impossible to read. Formatting JSON with proper indentation and line breaks makes the structure visible at a glance. This tool also validates your JSON and highlights syntax errors with the exact line number, helping you catch missing commas, unmatched brackets, or invalid values before they cause problems in your code.
How to Use This JSON Formatter
- Paste your JSON into the input area on the left. The validator instantly checks whether the JSON is valid.
- Click Format to beautify the JSON with your chosen indentation (2 spaces, 4 spaces, or tabs).
- Click Minify to compress the JSON into a single line, removing all unnecessary whitespace.
- Click Copy to copy the formatted output to your clipboard with one click.
Tips for Working with JSON
- Always use double quotes for keys and string values. Single quotes are not valid in JSON.
- Trailing commas after the last item in an object or array are not allowed in JSON, even though JavaScript permits them.
- Use minified JSON for network requests and storage to reduce payload size, and formatted JSON for debugging and documentation.
- Large integers (more than 15-16 digits) lose precision in many JavaScript tools. This formatter keeps them as written, but check how the program that reads your JSON handles them.