mockstack.

JSON Formatter

READY ← Developer & Data

Paste JSON, YAML, CSV, or XML. Format, validate, and minify, convert between them, or type it as a TypeScript interface.

Input
Output
READY CMD+S COPIES · JSON5 TOLERATED · SMALL INPUTS SAVE TO THE URL · RUNS LOCALLY

About the JSON Formatter

Formats, validates and converts structured data, in your browser. Settings sit in the left rail, the editor fills the center, and the analysis panels on the right read whatever the editor holds. Files drop straight onto the page.

Every Setting

Input
Auto-Detect works out which format you pasted and says so under the pills; force JSON, YAML, CSV, or XML only when a document is ambiguous. YAML covers the whole language, anchors, merge keys, and multi-line blocks included, and a file with several documents becomes an array. CSV can be separated by commas, tabs, semicolons, or pipes, so a paste from a spreadsheet works as it is. In XML, attributes become keys starting with @, and a tag that repeats becomes an array. Parse errors point at the actual line.
Output
Pretty prints readable JSON, Minify strips it for shipping, YAML, CSV, and XML convert across formats, and TypeScript writes the type definition your payload implies. CSV gives nested objects and lists their own columns, named by path like user.name or tags.0, and Separator picks commas, semicolons (what Excel expects in much of Europe), or tabs.
View
Both panes side by side, or just the input or output when one deserves the full width.
Pane Divider
Drag the bar between the panes to deal the width yourself; it remembers your split. Double-click it to reset, which also restores the automatic lean toward whichever pane you are typing in.
Indent
Two spaces, four, or tabs in the pretty output. Sort Keys alphabetizes every object, which makes two documents comparable line by line.
Open / Sample / Clear
On the input pane: Open reads a JSON, YAML, CSV, or XML file (you can also drop one on the card); Sample loads a small working document to poke at; Clear empties everything and starts the page fresh.
Text / Tree
How the output renders. Text is the raw result; Tree is a collapsible outline, which is how a five-level structure stays readable. Click any tree row to copy its path into your clipboard.
Copy Output / Download
Copy Output puts the result on the clipboard (Cmd+S does the same); Download saves it with the right extension for the output format.
Query
A JSONPath like $.items[*].sku pulls just that part out of a big payload, live as you type. The result prints directly under the box.
Schema Check
Paste a JSON Schema and the current document is validated against it as you edit: missing required keys, wrong types, each named with its path.
Diff
Paste a second JSON and get a structural comparison against the editor: changed values, added and removed keys, ignoring formatting entirely.
Stats
Keys, depth, minified size and gzipped size for the current payload, so you know what you are actually shipping.

Common Questions

My input will not parse. Now what?
The error names the line and what was expected there. The usual culprit is an unquoted key. Comments, single quotes, and trailing commas still parse, flagged as not strict JSON because most parsers reject them.
Is my data sent anywhere?
No. Everything parses on your machine, and the share link only carries small inputs, encoded in the link itself.

Related: Code Beautifier, Diff Checker, Base64 and URL Encoder.