Skip to main content

JSON Formatter & Validator

Runs locally

Format, validate, minify, repair, sort keys and query JSON with Tree and Table views.

What is JSON Formatter & Validator?

Format, validate, minify, sort keys, and repair JSON directly in your browser. Inspect nested payloads with interactive Tree and Table views, run JSONPath queries, validate against JSON Schema (drafts 07 and 2020-12), and preserve BigInt precision without ever uploading your data.

How to use JSON Formatter & Validator

  1. Step 1

    Paste JSON, JSON5, JSONC, or NDJSON into the editor or drop a file from disk.

  2. Step 2

    Choose your mode (Format, Minify, Validate, Sort keys, Repair, Escape, or Stringify) and indentation in Options.

  3. Step 3

    Switch between Code, Tree, and Table views or run a JSONPath filter to inspect large payloads.

  4. Step 4

    If syntax errors appear in the Problems panel, click a diagnostic to jump to the exact line and column or click Auto-fix.

  5. Step 5

    Copy, download as .json, or send the formatted output directly into JSON to TypeScript or JSON Diff.

Features

  • Strict JSON, JSON5, JSONC (comments), and NDJSON/JSON Lines parser modes
  • Auto-fix (jsonrepair) for trailing commas, single quotes, unquoted keys, and Python literals with a change summary
  • BigInt-safe number precision preservation above 2^53 and duplicate-key warnings
  • Interactive Tree view (expand/collapse to depth N, copy path/value) and sortable Table view with CSV export
  • JSONPath query search and JSON Schema (AJV) validation + schema generation from sample
  • Web Worker execution for multi-megabyte payloads with progress and cancellation

Example

Input

{'status':'ok','users':[{'id':9007199254740993,'name':'Ada',}],}

Output

{
  "status": "ok",
  "users": [
    {
      "id": 9007199254740993,
      "name": "Ada"
    }
  ]
}

Auto-fix repairs single quotes and trailing commas while preserving the 64-bit integer without rounding.

Frequently asked questions

What is a JSON formatter?

It re-indents JSON so it is readable, checks that it is valid and can also minify it for smaller payloads.

Is my JSON uploaded anywhere?

No. Formatting and validation run in your browser. Nothing is sent to a server.

How do I fix invalid JSON?

Use Auto-fix. It repairs common problems such as trailing commas, single quotes, unquoted keys, comments and truncated input, and shows you exactly what it changed.

What is the difference between format and minify?

Format adds whitespace for humans. Minify removes it to reduce size.

How large a file can I format?

It runs in a background worker, so large files work, but the practical limit depends on your device memory. If a file is huge, use Table or Tree view and search instead of the full text view.