JSONCraft

Formatter, diff, JSONPath, and schemas. Nothing is uploaded.

English

Format, diff, query, and type JSON locally

Valid JSON

Tree view
© 2026 JSONCraft · Your JSON stays in this browser · Partner links may earn a commission

Use the workbench

  1. Pick a mode: Format & Tree, JSON Diff, JSONPath, or TS / Zod / Schema.
  2. Load a realistic API preset or paste your own document.
  3. Format, compare, query, or infer types. Invalid JSON reports the line and column.
  4. Copy or download the result. The file never leaves this page.

Format JSON and fold it into a tree

Paste a payload into the input. Format prints it with two or four spaces, Minify removes the whitespace, and Sort Keys orders every object key recursively while leaving array order alone.

The tree labels each value as string, number, boolean, null, array, or object, shows how many keys or items it holds, and copies the JSONPath of any node. Expand All and Collapse All open or close the whole document.

Diff the data, not the whitespace

JSON Diff walks two parsed values. A key that exists only on the right is Added, a key that exists only on the left is Removed, and a different value is Changed. Each row shows the path and the values.

Arrays are compared by index. Object key order does not count as a change. The summary reports how many paths were added, removed, and changed. The e-commerce preset opens with a before-and-after order so the three kinds of change are visible immediately.

JSONPath quick reference

The expression reads the document beside it. The chips load examples that match the e-commerce order: names, every price, items that are in stock, and the first two items.

Supported JSONPath forms
SyntaxMeaning
$The document root
.key or ['key']A child property, by dot or by brackets
*Every property of an object, or every element of an array
..keyThat property at any depth
[start:end]An array slice. The end index is exclusive
[?(@.key==value)]Keep elements whose property matches ==, !=, <, <=, >, or >=

TypeScript, Zod, and JSON Schema from one sample

Inference reads the sample you provide. Nested objects become named types. When array items do not share every key, the missing keys are optional. Null mixed with another type is nullable. If every string in a field is an email, an http(s) URL, or an ISO date, that field gets the matching format.

TypeScript is an interface plus a type alias. Zod is a strict z.object schema. JSON Schema uses Draft 2020-12, with required lists, additionalProperties set to false, and $defs for nested objects. Copy or download .ts, .zod.ts, or .schema.json. The root name field controls the top type.

Questions

Does my JSON leave this page?

No. Formatting, diffing, JSONPath, and schema generation run in your browser. There is no upload and no account.

What does the diff compare?

It compares parsed values. Added, removed, and changed paths are listed with the values and a count of each. Key order and whitespace are not changes.

Which JSONPath features work here?

Root $, dot and bracket names, wildcards, recursive descent with .., slices written as [start:end], and filters such as [?(@.inStock==true)].

How are optional and nullable fields decided?

A key absent from some array items is optional. Null mixed with another type is nullable. Conflicting types on one key become a union. Strings that all look like an email, a URL, or an ISO date pick up that format.

Can I keep the generated schema?

Yes. Each output has copy and download. The .ts, .zod.ts, and .schema.json files are produced on this page from the sample you pasted.

Partner offers

If you buy through a partner link, we may earn a commission. JSONCraft stays free, and the JSON you paste is not uploaded.