{ } JSON Formatter

JSON Formatter & Validator

Format, validate, minify, and explore JSON. 100% client-side — your data never leaves the browser.

Indent

INPUT

OUTPUT

What is JSON?

JSON (JavaScript Object Notation) is the most widely used data interchange format on the web. Originally derived from JavaScript, it is now language-independent and supported natively by virtually every programming language and API.

JSON has two fundamental structures: objects (key-value pairs wrapped in { }) and arrays (ordered lists wrapped in [ ]). Values can be strings, numbers, booleans, null, objects, or arrays — and they can be nested arbitrarily deep.

Common JSON Syntax Errors

  • Single quotes: JSON requires double quotes. {'name': 'Alice'} → {"name": "Alice"}
  • Trailing comma: A comma after the last item is invalid. [1, 2, 3,] → [1, 2, 3]
  • Unquoted keys: Keys must be quoted. {name: "Alice"} → {"name": "Alice"}
  • Missing brackets: Every { must have a matching }, every [ a matching ].
  • Invalid values: undefined, NaN, and functions are not valid JSON values.

Frequently Asked Questions

What is JSON?

JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write, and easy for machines to parse and generate. JSON is built on two structures: a collection of key/value pairs (object) and an ordered list of values (array).

How do I format JSON?

Paste your JSON into the input editor and click "Format". The tool will validate the JSON and produce a prettified version with proper indentation in the output editor. You can choose between 2 spaces, 4 spaces, or tab indentation.

What are common JSON syntax errors?

The most common JSON errors are: (1) using single quotes instead of double quotes for strings and keys, (2) trailing commas after the last item in an object or array, (3) missing closing brackets or braces, (4) unquoted property keys, and (5) using undefined or NaN as values (not valid in JSON).

What does "minify JSON" mean?

Minifying JSON removes all unnecessary whitespace (spaces, newlines, tabs) to produce the smallest possible valid JSON string. This reduces file size and is typically used before sending JSON over a network or storing it.

Is my JSON data safe?

Yes. All formatting and validation happens entirely in your browser using JavaScript. Your JSON data is never sent to any server. This tool has no backend processing your input.