JSON Formatter & Validator

Format and validate your JSON data with 2-space indentation or minify it for production. Runs entirely in your browser memory.

100% private, runs in browser Free, no sign-up
Waiting for input
100% private. Nothing you paste leaves your device.

JSON details

0 total keys
  • Input length0 chars
  • Minification compression0%

Formatting and syntax validation are performed entirely in your browser using standard JavaScript ECMAScript JSON engines.

How to format and check your JSON

  1. Paste or type your JSON into the box above.
  2. Look at the status badge. If something is wrong, such as a missing bracket, a key without quotes or an extra comma, the error message appears straight away.
  3. Press "Beautify" to indent it with 2 spaces so it's easy to read, or "Minify" to remove all spaces and line breaks and make it as small as possible.
  4. Press "Copy to clipboard" to copy the result.

Example

JSON from an API often arrives on one long line:

{"name":"Alice","skills":["design","writing"],"active":true}

After "Beautify", each key is on its own line and nested items are indented:

{ "name": "Alice", "skills": [ "design", "writing" ], "active": true }

Common JSON errors and how to fix them

JSON looks like JavaScript, but its rules are stricter. These are the mistakes that cause most errors:

ProblemWrongRight
Comma after the last item{"a": 1,}{"a": 1}
Single quotes{'a': 'x'}{"a": "x"}
Key without quotes{a: 1}{"a": 1}
Comments{"a": 1 // note}{"a": 1}
Values JSON doesn't have{"a": undefined}{"a": null}

JSON also has no NaN or Infinity, and text inside quotes can't contain a real line break: write \n instead.

Your data stays on your device

JSON often contains things you shouldn't share, such as API keys, customer details or internal records. This formatter checks and formats your JSON with your browser's own built-in JSON engine. Nothing you paste is sent to us or anyone else, and it's gone when you close the page.

Frequently asked questions

What causes most JSON errors?

A comma after the last item in a list or object, single quotes instead of double quotes, and a missing closing bracket or brace. The table above shows how to fix each one.

Can I format a large file?

Yes. Files of a few megabytes are usually formatted in a moment. Very large files can be slow on older phones and computers, because all the work happens on your own device.

What's the difference between JSON and a JavaScript object?

A JavaScript object can use single quotes, keys without quotes, comments and values like undefined. JSON allows none of these. If you've copied an object out of JavaScript code, you may need to fix those parts before it counts as valid JSON.

Should I beautify or minify?

Beautify when people need to read it, for example when you're checking an API response or editing a settings file. Minify when a program reads it and size matters, for example data sent over a network.

Keep going

Related tools

All Developer tools

Disclaimer: results are estimates for planning only and are not tax, legal or financial advice. Rules and rates vary by country, state and personal situation. Check with a qualified accountant before making decisions. Read the full disclaimer.

Last updated: