About this tool
JSON (JavaScript Object Notation) is the standard data format for APIs, config files, and structured data exchange, but hand-written or minified JSON is hard to read and easy to break with a stray comma or missing quote. This formatter parses your JSON in the browser, pretty-prints it with your choice of indentation, and tells you exactly what's wrong if it fails to parse — no data ever leaves your device.
How to use it
- 1Paste or type your JSON into the input box on the left.
- 2Choose an indent width (2 spaces, 4 spaces, or none for a compact single-line style).
- 3Click "Format / Validate" to pretty-print valid JSON, or see a plain-English error if it's invalid.
- 4Use "Minify" instead if you need a compact, whitespace-free version for production.
- 5Click "Copy" to copy the result to your clipboard.
Common mistakes to avoid
- Using single quotes instead of double quotes around keys and string values — JSON requires double quotes.
- Leaving a trailing comma after the last item in an array or object, which most JSON parsers reject.
- Forgetting to escape special characters like backslashes or newlines inside string values.
- Mixing up JavaScript object literals (which allow unquoted keys) with strict JSON.
Use cases
- Debugging an API response that came back as a single unreadable line.
- Cleaning up a config file before committing it to version control.
- Validating JSON before pasting it into code, a database, or a request body.
- Shrinking a JSON payload with minify before sending it over the network.
Frequently asked questions
Is my JSON data uploaded to a server?
No. Formatting and validation happen entirely in your browser using JavaScript's built-in JSON parser. Nothing you paste is sent anywhere.
Why does it say my JSON is invalid even though it looks fine?
The most common causes are trailing commas, single quotes instead of double quotes, or unquoted object keys. The error message shows the position where parsing failed so you can find the issue quickly.
What's the difference between formatting and minifying?
Formatting adds indentation and line breaks so JSON is easy for humans to read. Minifying removes all unnecessary whitespace to make the payload as small as possible, which is better for production traffic.