JSON Formatter and Validator

Input

Output


      
      
Your result shows up here.

About the JSON Formatter and Validator

JSON is the format most web APIs, config files and apps use to exchange data. A single missing comma or stray quote makes a whole file invalid, and the error messages that tools give are often hard to read.

Paste or upload JSON and this tool checks it right away. If it is valid you can format it with 2 spaces, 4 spaces or tabs, minify it, sort the keys, browse it as a collapsible tree, copy it or download it. If it is not valid, you see the line and column of the first problem, a plain explanation and hints for common mistakes. Everything runs in your browser.

How to format JSON

  1. Paste your JSON or upload a file.
  2. Fix any error shown with its line and column, or use the suggested fix.
  3. Choose Format, Minify or Tree, pick the indentation and turn on Sort keys if you want.
  4. Copy the result or download it as a .json file.

Frequently asked questions

How do I validate JSON?

Paste or upload your JSON. The tool checks it as you type and tells you whether it is valid. If it is not, it shows the line and column of the first problem and explains what is wrong.

What are the most common JSON errors?

Trailing commas, single quotes instead of double quotes, property names without quotes, comments, and missing commas between items. JSON also does not allow values such as undefined, NaN, True, False or None.

What is the difference between formatting and minifying?

Formatting adds line breaks and indentation so JSON is easy to read. Minifying removes all the extra whitespace so the file is as small as possible. The data stays the same.

Does sorting keys change my data?

No. It only changes the order of the properties inside each object, which makes two files easier to compare. Arrays keep their order.

Is my JSON uploaded anywhere?

No. Everything runs in your browser and nothing leaves your device.

Are large numbers kept exact?

Yes. Numbers and strings are copied as written, so long IDs and high-precision decimals are not rounded the way JavaScript would round them.