JSON Formatter and Validator

Paste JSON to format, minify and validate it. If something is wrong we point to the line and column.

Your data stays on your computer. Files are processed in your browser and are never uploaded.

Drop a .json file on this area (10 MB max), or

0 characters · 0 bytes

The result appears here when the JSON is valid.

Keyboard shortcuts

In this tool

This tool has no keyboard actions.

Everywhere

Open this panel (outside text fields)
?
Closes panels and menus, never clears data
Esc
Search for a tool
/ or CtrlK

How to use it

  1. Paste the JSON into "Input JSON", or drop a .json file on the area (up to 10 MB). "Try an example" shows how it works.
  2. Under "Action" choose "Format" to make it readable or "Minify" to strip spaces and line breaks.
  3. When formatting, choose the "Indentation" (2 spaces, 4 spaces or Tab) and, if needed, turn on "Sort keys".
  4. If the JSON is correct you see "Valid JSON" with its size, key count and depth; otherwise "Invalid JSON" with the line and column of the error.
  5. Copy the "Result" or use "Download .json".

Frequently asked questions

How do I find the error in invalid JSON?

The tool gives the line and column where the JSON stops being valid. The most common errors are an extra comma after the last item, single quotes instead of double quotes, and keys without quotes.

Does JSON allow comments or trailing commas?

No: the JSON standard has no comments, no single quotes and no comma after the last item. Text with those features may be valid JavaScript, but it is not valid JSON.

What is the difference between formatting and minifying?

Formatting adds line breaks and indentation to make it readable; minifying removes them to get shorter text, useful to cut the size. The content stays the same.

What is "Sort keys" for?

It sorts object keys alphabetically: handy for comparing two JSON documents or getting a consistent result. The order of items in arrays does not change.

Does it change my data?

No: the values stay the same. Only whitespace changes and, if you ask, the order of the keys.

Is there a size limit?

A file you load can be at most 10 MB. With very large text the page may slow down, depending on your device.

Privacy

The JSON stays in your browser and is not sent anywhere. If you use the share button, the content goes into the link's address after the # sign: that part never reaches a server, but whoever receives the link can see it.

Tool chains

Link several tools into a path: after using a tool, “Send to…” offers the next step first. Saved chains keep only a name and the tools, never your data.

Saved chains

No saved chains.

New chain