Flutter 3.50 is live! Read the blog post

JSON Formatter & Validator

Paste JSON to format, validate, or minify — 100% client-side.

Paste JSON below
Input
Output

Related Tools

// more about this tool

Why use this tool

API responses logged to a terminal come back as one unreadable line. Config files hand-edited by someone else lose their formatting. A webhook payload from a third-party service arrives minified with no whitespace at all. This exists for exactly those moments, when you need to actually read the structure of a piece of JSON — not just look at a wall of characters — or confirm it's valid before you paste it somewhere that will reject it silently.

Paste JSON and it gets pretty-printed with consistent two-space indentation, or minified down to a single line if you need to paste it somewhere space-constrained, like an environment variable or a curl command. If the JSON is invalid, the error message tells you what broke instead of leaving you to scan the whole payload by eye.

How it works

  1. Paste JSON into the input panel — formatting happens automatically as you type.
  2. Check the status badge: valid JSON shows a key and nesting-depth count, invalid JSON shows the parser's error message.
  3. Use Minify to collapse the formatted output to a single line, or leave it pretty-printed.
  4. Copy the result, or hit Clear and start over with the Sample button for a quick example.

Example

Minified in

{"name":"bidev","tools":["qr","json"]}

Formatted out

{
  "name": "bidev",
  "tools": [
    "qr",
    "json"
  ]
}

FAQ

Does this validate against a schema?

No — it only checks that the text is syntactically valid JSON, not that it matches a particular shape or set of required fields.

How does it report where the error is?

It surfaces the underlying JavaScript JSON parser's own error message, which typically names the position or nearby token where parsing failed, rather than re-implementing its own error locator.

Minify vs. format — when should I use which?

Format when you're reading or debugging a payload by eye; minify when you need the smallest possible representation to paste into a space-constrained field like an environment variable.

Is there a size limit?

No hard limit is enforced, but very large payloads (megabytes of JSON) will be slower to parse and format in the browser than a dedicated desktop tool.

What do the key count and depth numbers next to Valid JSON mean?

Key count is the total number of object keys across the whole structure, and depth is how many levels of nesting the deepest branch reaches — both are a quick sanity check that a payload looks like you expect before you build code around it.

Can I use this to compare two JSON payloads?

Not directly — this tool is for formatting and validating one payload at a time. For comparing two API responses field by field, pair it with the API Response Diff Checker on this site.