Developer tools

JSON formatter & validator

Tidy or compress JSON and see exactly where it is broken.

This tool runs entirely inside your browser. No file or text is sent to any server.

How to use

  1. Type or paste your JSON into the upper box. To just try the tool, press “Insert an example”.
  2. Choose the shape of the result: “Tidy” or “Compact”. In the tidy shape you can change the indentation too, and in both shapes you can sort the keys alphabetically.
  3. The result appears under the box at once. If the JSON has a mistake, you see what it is and on which line and column instead of a result; “Go to the error” puts your cursor right there.
  4. Once it is fixed, take the result with the copy button.

Notes on this tool

The strictness is on purpose: no mistake is quietly corrected, because a tool that guesses what you meant could change your data without telling you. Every mistake is reported by name and place, and fixing it is up to you.

Only the spaces change, never the values. Numbers and strings stay exactly as you wrote them: a twenty-digit id is not rounded, 1.10 does not become 1.1, and Persian text is not turned into escape codes.

Persian digits are fine inside strings (between the quotes), but a number itself must use Latin digits: 12 is correct and “۱۲” is an error.

Keys are sorted by character code, not by any language’s alphabet: capital letters come before small ones, and Persian letters after English. The order of items inside an array is never changed, because there the order means something.

A key written twice in one object is not an error in standard JSON, so it is not one here either, and both are kept. You only get a warning, because most programs read just the last value and the first one silently disappears.

Frequently asked questions

What is JSON and what is it for?
JSON is a plain text format for storing and moving data: lists (arrays) and collections of “name: value” pairs (objects). Most websites and programs use it to talk to each other, to save settings and to fetch information from a server. Even if you do not program, you will probably meet it in a service’s answer or a settings file that has to be read or fixed.
Why does JSON I copied from JavaScript or Python code give an error?
Because the two look alike but JSON’s rules are stricter. The usual culprits: single quotes instead of double, a key without quotes, a comma after the last item, a comment, and True, None or undefined instead of true and null.
What is the difference between “Tidy” and “Compact”, and which should I use?
For the data there is no difference; only the spaces differ. The tidy shape is for reading, editing and comparing two versions. The compact shape is smaller and suits sending in a request, storing in a database or pasting on one line.
Why does the error message sometimes point at a place where nothing is wrong?
Because the tool reads from the start and stops at the first place it cannot go on. The real mistake is sometimes a little earlier: a forgotten comma shows up at the start of the next item, an unclosed bracket at the end of the text, and an unclosed quote a few lines further on. So if the line shown looks fine, look at the lines before it.
How big can the JSON be?
The tool sets no limit, and a file of several megabytes opens fine; on a weak device it may take a few seconds. The only limit is nesting deeper than a thousand levels, which gives an error.

Related tools

Strong password generator

Create a secure random password with the length and character mix you choose.

Passwords & security

QR code generator

Turn a link, phone number or any text into a QR code — in your browser, no internet needed.

Codes & data