JSON Nerd
A cartoon badger in round glasses, thinking

JSON Formatter and Validator

Format, validate and minify JSON in your browser.

Runs in your browser. Nothing you type is uploaded.

How the JSON formatter works

Paste JSON into the box and press Format to pretty-print it with 2 spaces, 4 spaces or tabs. Minify removes all optional whitespace, and Validate checks the syntax without changing anything. Turn on Sort keys to order object keys alphabetically.

FAQ

Is my JSON uploaded anywhere?

No. Everything runs in your browser, so API responses and config files stay on your device.

How do I find a syntax error?

If the JSON is invalid, the message shows what the browser's parser found and, where the browser reports it, the line and column. The error position is selected in the input box.

What are the most common JSON mistakes?

Trailing commas, single quotes instead of double quotes, unquoted keys, comments and a missing comma between items. Strict JSON allows none of these.

More JSON tools

  • JSON validator: Check JSON syntax and find the exact line and column of an error.
  • JSON beautifier: Pretty print JSON with 2 spaces, 4 spaces or tabs.
  • JSON minifier: Strip whitespace to make JSON as small as possible.
  • JSON to Go struct: Generate Go struct definitions with json tags from a JSON sample.
  • JSON to TypeScript: Generate TypeScript interfaces or types from a JSON sample.
  • JSON to Python: Generate Pydantic models, dataclasses or TypedDicts from a JSON sample.
  • JSON to Rust: Generate Rust structs with serde derives from a JSON sample.