JSON Formatter
Format, validate and minify JSON, with the error located by line.
What this tool does
Paste or upload any JSON and it gets checked, formatted, and made easy to work with. Beyond the basics — format, minify, and validate — this formatter also handles the parts that usually send people to a second tool: fixing JSON that has a small mistake in it, viewing it as a collapsible tree instead of raw text, sorting keys alphabetically, and converting it straight to YAML, CSV, or a TypeScript interface.
Fixing invalid JSON
When JSON fails to parse, the error message usually names a line and column but not much else. This tool locates that line for you and highlights it, so you're not scanning the whole file for one missing comma. For the common mistakes — a trailing comma, single quotes instead of double quotes, an unquoted key — the Try to repair option attempts an automatic fix rather than making you find it by hand.
Converting JSON to something else
Working with an API response usually means turning JSON into whatever format the next step needs:
- YAML — for config files and most CI/CD pipelines.
- CSV — for a spreadsheet, when the JSON is an array of objects with the same shape.
- TypeScript interface — a typed shape generated straight from real data, so you’re not writing it out by hand from an API doc.
Reading and editing the structure
The tree view shows nested objects and arrays as a structure you can collapse and expand, which is faster than reading deeply nested JSON as plain text — useful for a large or unfamiliar payload. Sort keys puts every object's keys in alphabetical order, which makes two JSON files easier to diff. Escape and unescape convert between a JSON string and the string-inside-a-string form you get when JSON has been serialized twice, e.g. logged from a server.
Privacy
Everything happens in your browser. The JSON you paste is never sent to a server — there's no upload step to skip, because there isn't one. That also means it works offline once the page has loaded, and there's no size limit beyond what your browser can hold in memory.
Frequently asked questions
Is my JSON data uploaded anywhere?
Why does my JSON say it’s invalid when it looks fine?
Can it convert JSON to a TypeScript interface?
interface from the shape of your actual JSON data, including nested objects and arrays.