JSON Formatter and Validator
Format, validate and minify JSON right in your browser. It pinpoints the line and column of each error, sorts keys and shows stats.
This runs entirely in your browser. We don’t store any data.
How to use it
- 01
Paste your JSON into the box on the left. It’s validated as you type.
- 02
Choose whether to format it with indentation or minify it onto a single line.
- 03
If there’s an error, you’ll see the exact line and column.
- 04
Copy the result, or use it as your new input.
How it works
Your text is parsed by the browser’s built-in JSON parser, which follows the RFC 8259 standard. If parsing fails, the tool steps through the text using the JSON grammar to find the first invalid character, since every browser words its error messages differently.
The most common mistakes are trailing commas ([1, 2,]), single quotes instead of double quotes, unquoted keys and comments, which JSON doesn’t allow even though JavaScript does.
Everything runs on your device, so it’s safe to paste API responses or config files with sensitive data: nothing is sent to a server.
Examples
- API response
Paste a one-line API response to read it with proper indentation and see how many objects and keys it has.
- Finding a trailing comma
In {"a": 1, "b": 2,} the tool flags the “}” in column 17, right after the trailing comma.
- Comparing config files
Sort the keys in two JSON files, then paste them into the text compare tool to see exactly what changed.
Frequently asked questions
Why does my JSON with comments throw an error?
Because standard JSON doesn’t support comments. Some tools, like VS Code settings and tsconfig, use JSONC, a variant that allows them, but it isn’t valid JSON.
Does sorting the keys change the meaning?
No. Key order in a JSON object doesn’t carry any meaning. Item order in an array does, and the tool never changes it.
Related tools
- 10.04
Base64 Encoder and Decoder
Developer tools - 10.05
URL Encode and Decode
Developer tools - 06.04
Text Compare
Text tools - 10.01
UUID Generator
Developer tools - 10.02
QR Code Generator
Developer tools - 10.06
MD5, SHA-1 and SHA-256 Hash Generator
Developer tools - 10.07
HEX, RGB and HSL Color Converter
Developer tools - 10.08
Unix Timestamp Converter
Developer tools