JSON Formatter and Validator
Pretty-print, minify and validate JSON in your browser. Your data is not uploaded.
JSON formatter
Paste JSON and choose how to format it.
Result
Formatted JSON
{
"name": "Ada",
"tags": [
"math",
"code"
],
"born": 1815
}Valid JSON
Status
49 bytes in, 75 bytes out
Size
Private: Everything runs in this page. Nothing you type is sent anywhere or saved.
On this page
Valid and invalid JSON
| Text | Result | Why |
|---|---|---|
| {"a":1} | Valid | valid |
| [1,2,3] | Valid | valid |
| {'a':1} | Invalid | single quotes are not allowed |
| {"a":1,} | Invalid | trailing comma is not allowed |
| {a:1} | Invalid | keys need double quotes |
Formula
parse the text as JSON, then write it again with the layout you chose
How the json formatter works
- Step onePaste your JSON into the box.
- Step twoChoose 2 spaces, 4 spaces, a tab, or Minify. Tick Sort keys to order object keys A to Z.
- Step threeIf the JSON is not valid, the message says what the browser found. Copy the formatted result.
What this tool does not do
- It checks JSON syntax only, not the meaning of your data or any schema.
- Comments and trailing commas are not valid JSON and are reported as errors.
- Numbers with more than about 15 to 17 significant digits cannot be kept exactly by a browser; the tool tells you when a number was changed this way.
- A key that appears twice keeps only its last value; the tool tells you when that happens.
- Numbers are written in the shortest form (1.0 becomes 1, 1e2 becomes 100) with the same value.
Frequently asked questions
Is my JSON uploaded?
No. Parsing and formatting happen in your browser.
Why does my JSON fail?
The most common causes are single quotes, a trailing comma, unquoted keys and comments, none of which JSON allows.
Does sorting keys change the meaning?
For objects, no, because key order carries no meaning. Arrays keep their order.