JSON Formatter & Validator

Paste JSON to format it, check it for errors or minify it. Nothing is uploaded.

What this does

This JSON formatter makes JSON readable: it adds consistent indentation and line breaks, or removes them all to make the file as small as possible. It also checks that your JSON is valid and, if not, tells you exactly which line and column the problem is on. You can sort keys alphabetically and are warned about very large numbers that JavaScript would round. Your data never leaves your device, so it is safe for API keys and private data.

How to use it

  1. Paste your JSON, open a file, or drop one onto the box.
  2. Pick the indent you like, or Minify.
  3. Copy or download the result. If there is an error, press Go to error.

FAQ

Is my JSON sent anywhere?

No. Formatting and validation happen in your browser; nothing is uploaded or stored.

Why is my JSON invalid?

The most common causes are a trailing comma after the last item, single quotes instead of double quotes, keys without quotes, and comments, which JSON doesn't allow.

Why did a big number change?

JavaScript can only store whole numbers up to 9,007,199,254,740,991 exactly. Larger numbers, like some database IDs, are rounded, so the tool warns you. Store such IDs as strings.