JSON workbench
Validate, format, minify, sort, and repair JSON; browse and edit it as a tree; query with JSONPath; transform with JavaScript; and diff two documents.
Added · updated 28 October 2026
Works with
- JSON → types Formatting and referenceMake types sends the document there, and its Open in JSON workbench sends JSON back here
How to use it
Editor and tree
Paste or open a document. It is validated as you type; an error shows its line and column with a caret under the problem, and Go to line jumps there. Repair fixes the usual hand-written mistakes: comments, trailing commas, single quotes, and unquoted keys.
-
Format re-indents (2 spaces, 4 spaces, or tabs); Minify removes all whitespace and reports the saving. Cmd/Ctrl+Enter formats.
-
Sort keys orders every object’s keys alphabetically, recursively.
-
Make types opens the document in JSON → types for TypeScript, Zod, Java, Kotlin, Go, Rust, Python or protobuf types.
-
Escape turns the whole input into one JSON string literal (for embedding JSON in JSON); Unescape reverses it.
The tree mirrors the document. Click a node to see its JSONPath and JavaScript path (and copy either). Double-click a key to rename it or a value to edit it. Hover a row for actions: add a property or array item, move up or down, change type, copy, or delete. Every tree edit rewrites the text.
Query, transform, diff
-
Query runs JSONPath:
$.store.book[*].author,$..price,[0,2],[-1:],[1:3], and filters such as[?(@.price < 10 && @.isbn)]or[?(@.author =~ /^M/)]. -
Transform runs a JavaScript function of
datain a background worker, with helperspick,omit,groupBy,sortBy,uniq,sum, andflatten. Use as input copies the result back into the editor. -
Diff compares two documents structurally — formatting and key order are ignored — and lists every added, removed, and changed path.
-
Statistics shows depth, counts by type, key names, and sizes.
Documents over a megabyte are parsed and formatted in a background worker so the page stays responsive. Your last document is remembered in this browser only.
Sharing
Share link copies a URL that opens this tool exactly as configured. The document travels with the active tab’s input: ?text= and ?query= (JSONPath) when short, otherwise everything is packed into ?s= — including transform functions and both diff sides.
For example: json/?text=%7B%22a%22%3A%5B1%2C2%5D%7D&query=%24.a%5B1%5D.
Related: data wrangler — clean and reshape tables with a replayable recipe of steps (trim, retype, split, cluster, join, pivot), exported as SQL or pandas.
Feedback is a gift. Something to improve, a feature to add, or a bug? Tell me.
Runs entirely in your browser; nothing you type leaves this page.