Format & Convert

JSON Formatter

Format, validate, and inspect JSON in the browser.

Runs in your browser
Ready

            
Tree view No JSON loaded

About JSON Formatter

Use the JSON Formatter when you need to make an API response readable, verify that a payload is valid JSON, or inspect nested objects without sending the data to a remote formatter.

Common uses

  • Pretty-print compact API responses before sharing them in documentation.
  • Minify JSON before storing it in configuration fields.
  • Open the tree view to spot missing properties or unexpected data types.

Good to know

The formatter is strict about JSON syntax, so trailing commas, comments, and unquoted property names are reported as errors instead of being silently changed.

How to review formatted JSON

Start by formatting the payload, then scan the first validation error before changing anything. JSON parsers stop at the first invalid token, so one missing quote or bracket can make later lines look suspicious even when they are fine.

When the tree view helps

Use the tree view for nested API responses, webhook bodies, and configuration documents where the same property name appears in several branches. Collapsing objects makes it easier to check structure without losing the raw text.

Common mistakes

JavaScript object literals are not always valid JSON. Comments, trailing commas, single-quoted strings, undefined values, and unquoted keys must be removed before a strict JSON parser can accept the document.

Worked example: Reviewing a compact API response

Input
{"user":{"id":42,"active":true},"roles":["editor","reviewer"]}
Expected result
{
  "user": {
    "id": 42,
    "active": true
  },
  "roles": [
    "editor",
    "reviewer"
  ]
}

Formatting changes whitespace only. The object, array, number, and Boolean types remain unchanged, so this is safe for visual inspection but not a schema check.

Technical reference

The behavior described on this page was reviewed against ECMA-404: The JSON data interchange syntax. External standards remain authoritative when their requirements differ from a browser implementation.

Before you rely on the output

  • Use representative samples and validate the result in the target parser or application before replacing production configuration or data files.
  • Privacy mode: inputs are processed locally in your browser and are not intentionally sent to an application server.
An unhandled error has occurred. Reload x