Loading…

Developer tools10.03

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.

Back to Developer tools
Output

This runs entirely in your browser. We don’t store any data.

How to use it

  1. 01

    Paste your JSON into the box on the left. It’s validated as you type.

  2. 02

    Choose whether to format it with indentation or minify it onto a single line.

  3. 03

    If there’s an error, you’ll see the exact line and column.

  4. 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.