JSON Input
About JSON
What is JSON?

JSON (JavaScript Object Notation) is a lightweight data interchange format that is easy for humans to read and write, and easy for machines to parse and generate.

JSON Data Types
  • String: "Hello World"
  • Number: 42 or 3.14
  • Boolean: true or false
  • Null: null
  • Array: [1, 2, 3]
  • Object: {"key": "value"}
Common JSON Errors
  • Missing or extra commas
  • Unquoted keys (keys must be strings)
  • Single quotes instead of double quotes
  • Trailing commas after last element
  • Comments (JSON doesn't support comments)
Valid JSON Example
{
  "name": "John",
  "age": 30,
  "active": true,
  "tags": ["developer", "designer"]
}

How to Format and Validate JSON

Paste JSON into the box and choose format to indent it neatly, or minify to strip out spaces for a smaller payload. If the JSON is invalid, the error message tells you what went wrong and roughly where, which is usually quicker than scanning a long API response by eye.

Everything runs in your browser using the built-in JSON.parse, so API keys, customer data or anything else you paste never leaves your machine.

The mistakes that break JSON most often

  • Trailing commas, such as {"a": 1,}. JavaScript allows them; JSON doesn't.
  • Single quotes. Keys and strings must use double quotes.
  • Unquoted keys, such as {name: "Sam"}.
  • Comments. JSON has no comment syntax, so // and /* */ are errors.
  • Special values like undefined, NaN or dates written without quotes.

Frequently asked questions

Is my JSON uploaded anywhere?

No. Formatting and validation happen in your browser, so the data never leaves your computer.

What is the difference between formatting and minifying?

Formatting adds line breaks and indentation so people can read it. Minifying removes all unnecessary spaces so the file is smaller to send over a network. Both contain exactly the same data.

Why is valid JavaScript not valid JSON?

JSON is a stricter subset. It needs double-quoted keys and strings, and doesn't allow trailing commas, comments or values like undefined.

Related tools

All Developer & Web tools