JSON Formatter & Validator

Check that a document is valid JSON, then format it, minify it, or browse it as a tree. The formatter, validator, tree, and minify tabs share one input.

Search the input

object · 105 bytes · 4 keys · depth 3 · Ctrl+Enter or ⌘+Enter formats

How to use it

  1. Paste JSON or upload a local file up to 1.5 MB.
  2. Choose 2 or 4 spaces, then format. Ctrl+Enter or ⌘+Enter does the same.
  3. Open Validator for the error location, Tree to collapse objects, or Minify for a single line.
  4. Search the input, then copy or download the result.

Common mistakes

  • Comments and trailing commas are not valid JSON.
  • Single quotes around keys or strings will fail validation.
  • A large file over 1.5 MB is rejected before it is parsed.

Examples

Format an object

{ "b": 1, "a": [true, null] }

becomes a two-space document with the same key order.

Read a syntax error

{ "ok": true, }

A trailing comma is invalid. The message includes a line and column when the engine reports a position.

Frequently asked questions

Processing stays in this browser tab. What you paste is not uploaded, and this tool does not write it to local storage.