JSON Formatter and Validator
Format, validate and minify JSON in your browser, see it as a tree with paths, and fix JavaScript-style JSON. Big numbers stay intact. Nothing uploaded.
Runs in your browser. Nothing you enter is uploaded.
How to use
This tool formats JSON so it is easy to read, checks that it is valid, and can minify it to a single line.
- Paste your JSON into the JSON input box, type it, or Open a file (or drop one on the page). The tool checks your JSON as you type and tells you if it is valid.
- Press Format to pretty-print it. Pick the indent you want: 2 spaces, 4 spaces or tabs. Turn on Sort keys to order every object's keys from A to Z.
- Press Minify to remove all spaces and line breaks. This makes the JSON as small as possible, which is useful for config values and API requests.
- Use Copy to put the result on your clipboard, or Download .json to save it as a file. Tree shows the JSON part by part: choose any part to see and copy its path, like
$.address.city, and its value.
If your JSON has a mistake, you see the line and column where it starts and a short explanation. Click the line number to jump to that spot in the input. When it's JavaScript or Python rather than JSON (single quotes, names without quotes, trailing commas, comments, True and None), Make it JSON fixes it and says what changed. A name used twice in one object gets a warning, as most programs keep only the last.
Numbers are kept exactly as you wrote them. Very long IDs like 12345678901234567890 are not rounded, and 1.0 stays 1.0. String escapes are also kept as written.
Inputs over 500 KB are processed in the background so the page stays responsive. Ctrl + Enter (Cmd + Enter on a Mac) formats.
Your indent and sort settings are remembered on this device. Your JSON is not saved anywhere.
Frequently asked questions
Is my JSON sent to a server?
No. Formatting and validation happen in your browser with JavaScript. Your data never leaves your device, so it is safe to use with private API responses or config files.
Why does it say my JSON has a trailing comma?
JSON does not allow a comma after the last item in an object or array, even though JavaScript does. Remove the comma before the closing } or ] and the JSON becomes valid.
Will formatting change my numbers?
No. Many formatters round long numbers because they convert them to JavaScript numbers. This tool keeps every number exactly as written, so long IDs and precise decimals stay the same.