Shridha/ tools

JSON Formatter

Paste JSON to check that it is valid and make it easy to read, or squeeze it onto one line. Your data stays in your browser.

Checked as you type. Nothing is sent anywhere.

Output

Paste JSON on the left. It is checked and formatted here.

How it works

Paste your JSON on the left. It is checked as you type, and the result shows on the right.

Choose 2 spaces, 4 spaces or a tab to indent it, or minified to remove all extra whitespace.

If the JSON is invalid, the message says what went wrong and, where the browser reports it, the line and column.

Good to know

JSON is strict. Keys and strings need double quotes, and a trailing comma after the last item is not allowed. These are the most common errors.

Formatting changes only whitespace. Very large numbers may lose precision, because JSON numbers are read as ordinary floating point numbers.

Frequently asked questions

Why is my JSON invalid?

Common causes are single quotes instead of double quotes, a trailing comma, a missing comma between items, unquoted keys, and comments, which JSON does not allow.

Is it safe to paste private data?

The JSON is processed in your browser and is not uploaded, so tokens and records do not reach a server. Avoid pasting real secrets into any tool unless you need to.

What does minify do?

It removes spaces and line breaks so the JSON is as short as possible, which is useful for sending it over a network or putting it in a single line.

Related tools