All Tools

JSON Formatter & Validator

Paste JSON to format, beautify, and validate it instantly. Clear error messages show exactly where syntax problems are.

Formatted output will appear here

Tips & Guide

Validate before using

Paste JSON from an API response or config file to instantly check whether it is valid. The formatter shows a clear error message with the position of any syntax mistake.

Minify vs prettify

Formatted (prettified) JSON uses indentation and line breaks for readability. Minified JSON removes all whitespace to reduce file size. This tool prettifies JSON — use the formatted output when debugging, and minify for production use in APIs.

Common JSON errors

The most common mistakes in JSON are: trailing commas after the last item in an object or array (not allowed in JSON, only in JavaScript), using single quotes instead of double quotes, and unquoted property names.

JSON vs JavaScript objects

JSON is a text format derived from JavaScript object syntax, but they are not the same. JSON requires double quotes around all keys and string values, does not support undefined, functions, or comments, and must have a single root value.

Paste any JSON into the input panel and click Format to beautify it with proper indentation and validate its syntax. All processing is done in your browser.

How to use the JSON Formatter & Validator

  1. Paste your JSON into the left input panel.
  2. Click Format JSON to parse and prettify the JSON.
  3. If the JSON is valid, the formatted output appears on the right with a green confirmation.
  4. If the JSON contains errors, a red alert shows the exact error message and position.
  5. Click Copy to copy the formatted output to your clipboard.
  6. Click Clear to reset both panels.

Examples

Minified JSON input

{"name":"Alice","age":30,"city":"London"}

After formatting

{ "name": "Alice", "age": 30, "city": "London" }

Invalid JSON (trailing comma)

{"key": "value",} → Error: Unexpected token }

How to calculate manually

Common JSON syntax rules

  1. All keys must be strings wrapped in double quotes: {"key": value}
  2. String values must use double quotes, not single: {"name": "Alice"}
  3. No trailing commas — the last item in an object or array must not have a comma after it
  4. Numbers, booleans (true/false), and null are valid values without quotes
  5. Arrays use square brackets: [1, 2, 3]

Valid JSON: {"name": "Alice", "scores": [10, 20, 30], "active": true}

JSON (JavaScript Object Notation) was popularised by Douglas Crockford in the early 2000s as a lightweight alternative to XML for data interchange. It was formally specified in RFC 4627 in 2006. Despite its name, JSON is now used with nearly every programming language and is the dominant format for REST APIs, replacing XML almost entirely in web development.

Frequently asked questions

What makes JSON valid?

Valid JSON uses double-quoted property names and strings, commas between items, matching braces and brackets, and the values true, false, null, numbers, strings, arrays, or objects. It does not allow comments or trailing commas. Paste the complete document into the validator to locate syntax problems before sending it to an API.

Does formatting change my JSON data?

Formatting adds indentation and line breaks to make the same structure easier to inspect. It should not change property names, values, or array order. Validate the result after editing, and remember that a formatter is not a schema checker: syntactically valid JSON can still contain missing fields or values an application rejects.

Can I paste confidential JSON here?

Treat any online formatter as unsuitable for secrets unless you have assessed its privacy model. Never paste passwords, API keys, session tokens, private customer data, or production exports into an untrusted page. For sensitive material, use a local developer tool or remove and replace confidential values before formatting.

Why does valid JSON still fail in an API?

A validator checks JSON syntax, not whether the document matches an API’s schema, types, required fields, or business rules. Compare property names and value formats with the endpoint documentation, then inspect the server’s error response. Validate a minimal test payload before adding optional or nested data.