JSON Formatter
Paste or type JSON and format it with indentation for readability, or minify it by removing extra whitespace. The tool validates as it formats—invalid JSON will show an error. All processing is done in your browser; nothing is sent to a server.
Format or minify JSON
How it works
We use the browser’s built-in JSON.parse to validate and JSON.stringify to reformat. Pretty format uses a 2-space indent. Minify produces a single line. If parsing fails, we show the error message so you can fix the JSON.
Example: Minified {"a":1,"b":2} formatted becomes multiple lines with indentation. Trailing commas or single quotes are invalid in JSON and will cause an error.
When to use it
Use it to debug API responses, prepare config files, or make minified JSON readable. Always validate before sending data to another system.
Frequently asked questions
- Is my JSON sent to a server? No. Parsing and formatting run in your browser. Nothing is uploaded.
- What if my JSON is invalid? We use JSON.parse and show the error message. Fix the reported position and try again.