Pages

Topics

Tools

↑↓navigate↵openescclose
Formatting & Data

JSON Formatter

Format, validate, and minify JSON, explore it as a foldable tree or a sortable table, filter it by JSONPath, flatten it to a.b[0] keys and back, open a local .json file, repair broken syntax, and generate TypeScript, Zod, Go, Pydantic or Rust types.

Runs entirely in your browser — nothing you paste is uploaded.

JSON cheat sheet

quick reference
JSON.parse(text)
Parses a JSON string into a value and throws SyntaxError on a trailing comma or single quote.
JSON.stringify(value, null, 2)
Pretty-prints with a two-space indent; the third argument can be a string or a number of spaces.
undefined, function
Dropped from objects, but they become null inside arrays during serialization.
Date
Serialized through toJSON(), so a Date always becomes an ISO 8601 string such as 2026-11-16T05:00:00.000Z.
"{\"a\":1}"
An escaped JSON string stored in logs or env vars needs one unescape pass before it can be parsed.
$.posts[*].slug
JSONPath for the path filter: $ is the root, .key reads an object key, [0] reads an array index and [*] collects every item.

Frequently asked questions

answered below the tool
How do I fix a trailing comma in JSON?

Press Auto-fix: it removes trailing commas, comments, single quotes and unquoted keys, then re-validates the result before you copy it.

What is the difference between the TypeScript and Zod output?

TypeScript gives interfaces for typing a variable, while Zod gives a runtime schema that also validates the data it parses.

Can I turn JSON into Go, Python or Rust types?

Yes. Besides TypeScript and Zod, the output menu writes a Go struct, a Pydantic model or a Serde struct with the right field tags and optional fields.

All TypeScript guides