JSON Formatter and Validator

Format, minify and validate JSON in your browser.

About this tool

JSON is a text format used by web APIs, configuration files and data exports. It is easy for programs to read, but a long JSON string on a single line is hard for people. This tool turns it into a neat, indented layout, shrinks it back down, and tells you whether it is valid.

How to use it

Paste your JSON into the box. Press Format to indent it with two spaces per level, or Minify to remove every space and line break that is not needed. If the text is not valid JSON, the tool shows the error from the parser, which usually points to the position of the problem.

Common JSON errors

Trailing commas are the most frequent mistake: JSON does not allow a comma after the last item in an object or array. Keys and strings must use double quotes, never single quotes. Comments are not part of JSON. Values can be strings, numbers, true, false, null, arrays or objects, but not undefined or functions. Numbers cannot have leading zeros, and special values such as NaN are not allowed.

Format or minify?

Use the formatted view when you are reading, debugging or reviewing a change. Use the minified view when you send data over a network or store it, because it is smaller. The two forms mean exactly the same thing to a program.

Working with API responses

When you copy a response from a browser's network panel or a command line tool, paste it here to see the structure. Look at the nesting to find which array or object holds the field you need. Valid output means the data can be read by any standard JSON parser.

Limits

This tool uses the JSON parser built into your browser. Very large files, many megabytes in size, may be slow. Key order is kept as written, and duplicate keys keep the last value, as the standard parser does.

Privacy

Your data never leaves your device. Parsing and formatting happen in the page, so it is safe to check JSON that contains private values. Even so, avoid pasting real passwords or secret keys into any website out of habit.

Frequently asked questions

Is the json formatter and validator free to use?

Yes. The json formatter and validator on QuickKit is free, needs no signup and has no usage limit.

Is my data safe when I use the json formatter and validator?

Yes. The json formatter and validator runs in your browser. What you enter is processed on your device and is not uploaded to a server.

Does the json formatter and validator work on a phone?

Yes. The page is built to work on phones, tablets and desktop browsers without installing anything.

More free tools