Format & Convert
JSON Formatter & Validator
Pretty-print, minify, sort keys and validate JSON with precise error locations.
Loading the JSON Formatter & Validator…
About the JSON Formatter & Validator
Paste JSON to pretty-print it with 2 or 4 spaces or tabs, minify it, or sort its keys alphabetically. Invalid JSON is pinpointed to the exact line and column, with a plain-language hint for common mistakes such as trailing commas, single quotes and unquoted keys. Duplicate keys and integers too large for JavaScript are flagged instead of being silently changed.
How to use it
- Paste or type your JSON.
- Choose the indentation, or Minify.
- Copy or download the formatted result.
Frequently asked questions
- Why is my JSON invalid?
- The most common causes are trailing commas, single quotes instead of double quotes, unquoted property names and comments. The validator names the problem and shows where it is.
- Does formatting change my data?
- No. Formatting only changes whitespace and, if you ask, key order. Values are kept exactly, and the tool warns when an integer is too large to be represented exactly.
- Is my JSON uploaded?
- No. Everything runs in your browser tab with JavaScript. Nothing you enter is uploaded, logged or stored, and the page works offline once loaded.