JSON Format / Validate

Format, beautify, minify and validate JSON online. Shows the exact line and column of syntax errors and can sort keys. Free, fast, and private.

About this tool

The JSON formatter pretty-prints, minifies and validates JSON. When the input is invalid it tells you the line and column of the first syntax error, so you can fix broken API responses or config files quickly.

How to use

  1. Paste JSON into the Input panel or click Sample.
  2. Choose 2 spaces, 4 spaces, tab or Minify, and optionally Sort keys.
  3. Copy the result from the Output panel.

Frequently asked questions

Is my JSON uploaded anywhere?

No. Formatting and validation run in your browser with JavaScript. Nothing is sent to a server.

Why does it say "Invalid JSON"?

Common causes are trailing commas, single quotes instead of double quotes, comments or unquoted keys. The status bar shows the line and column where parsing stopped.

What does "Sort keys" do?

It sorts object keys alphabetically at every level, which makes two JSON documents easier to compare.

Related tools