Tutorial & guide

How to Format and Validate JSON

JSON is a text format commonly used to exchange structured data between applications and APIs. Formatting makes it easier to read; validation checks whether the text follows JSON syntax.

Try the related tool

JSON Formatter →

JSON building blocks

A JSON value can be an object, array, string, number, boolean or null. Objects contain key-value pairs with double-quoted keys. Arrays contain ordered values. JSON does not support comments, trailing commas, undefined values or single-quoted strings.

How to format JSON

Paste the JSON text into the formatter and choose the indentation level. A successful parse means the text is syntactically valid JSON; it does not prove that the data matches an API schema or business rule.

Common errors

Check these issues when parsing fails.

  1. Use double quotes around property names and string values.
  2. Remove trailing commas after the final property or array item.
  3. Use true, false and null in lowercase.
  4. Escape special characters inside strings, such as quotation marks and backslashes.
  5. Check matching braces and brackets.

Worked example

Compact input: {"name":"Asha","active":true,"scores":[8,9]}. Formatted output makes the object, boolean and nested array easier to inspect while preserving the same data.

Privacy and sensitive data

Do not paste production secrets, access tokens, passwords or personal records into tools unless you understand where they are processed. This site’s JSON formatter is designed to parse input locally in your browser; still avoid sharing screenshots or copied output containing confidential information.

Quick example

{"name":"Asha","active":true,"scores":[8,9]} is valid JSON; single quotes and trailing commas are not.

Frequently asked questions

Does valid JSON mean my API request is correct?

No. JSON syntax validation does not verify required fields, data types or API business rules.

Can JSON contain comments?

Standard JSON does not support comments.