JSON Formatter
Format and validate JSON.
How it works
Format and validate JSON.
FAQ
This tool is free for core use.
When should you use this?
Use this when you need to turn a cramped, single-line JSON payload into readable, indented text; it makes inspecting an API response or debugging much easier.
When shouldn't you use this?
If the JSON actually has a genuine syntax error (a missing comma, say), formatting won't fix that, you'll need a validator to find the error first.
Step-by-step
- Paste your JSON into the text area on the page. It could be an API response, a package file or a settings file.
- Click "Format" for readable, indented output.
- Click "Minify" to collapse the data onto one line with no extra whitespace.
- If there's a syntax error, the tool reports it. Fix the problem and press the same button again.
Example
You're trying out a weather API, and the URL you opened in the browser returns one very long line. Paste it in and hit Format, and the location info, current conditions and hourly forecast array separate into their own blocks. Seeing which field sits at which level makes it much easier to write the code that reads it. Later, if you need to stash that sample data in an environment variable or a single-line config field, hit Minify to compact it again.
Formatting and minifying JSON
The same JSON can be written in two forms: readable (indented) and minified (a single line). For development and debugging the indented version helps; when sending over the network or when file size matters the minified one is better. The formatter lets you switch between these two states and also catches syntax errors.
Tips
- Make sure the data is valid JSON before formatting.
- Hide sensitive data (keys, personal information) in screenshots you share.
- Remember that very large numbers (over 16 digits) can lose precision in some systems.
- The number of indent spaces only changes appearance, not meaning.
Things to keep in mind
- Standard JSON doesn't allow comments. Notes starting with // that you see in some config files will be flagged as errors by a strict parser.
- Keys and string values need double quotes. Single-quoted or unquoted keys copied from a JavaScript object are invalid JSON.
- Minifying only removes formatting whitespace. Spaces inside string values are left alone, so the data means exactly the same thing.
- With a very large response, copy just the part you care about first. The page stays responsive and you find what you need faster.
Related ready-made prompts: Coding Prompts.
Frequently asked questions
Is the code/data I enter stored anywhere?
No, nothing is sent to a server or stored; processing happens entirely in your browser.
Does it work with large inputs?
Yes, though performance may degrade with very large inputs (several MB or more).
Is this tool free?
Yes, it's completely free for core use and requires no account.