SellstampJSON formatter
Paste JSON to pretty-print it with 2 or 4 spaces or a tab, or minify it. Invalid JSON gets the line and column of the error and what was expected.
Parsed and formatted in your browser; nothing you paste is sent anywhere.
Stays on your device
Everything runs in your browser. Nothing you type is sent to Sellstamp or anyone else.
Building something to sell?
Sellstamp has a storefront, a checkout into your own payment account, automatic delivery and an API with webhooks. Open a free store
How to use it
- Paste your JSON.
- Choose 2 spaces, 4 spaces, a tab, or Minify.
- If it is invalid, read the line and column and the reason, and fix that spot.
- Copy the result.
What the error actually tells you
Invalid JSON gets the line and column of the first character the grammar cannot accept, and what it expected there. The usual causes are the things JavaScript allows and JSON does not: a trailing comma before a closing bracket, single quotes around a string, an unquoted key, a comment, or a number written .5 or 01. Each of those is named specifically rather than reported as “unexpected token”, because the fix is different for each.
Validity is decided by your browser’s own JSON.parse; the location is worked out separately, only when it fails, so a value that formats here is a value every JSON parser accepts.
What formatting changes, and what it does not
Whitespace and key order are the only things pretty-printing and minifying touch, with one exception worth knowing: numbers are normalised on the way through. 1.0 comes out as 1, 1e2 as 100, and an integer larger than 253 — a 64-bit database id, say — loses its low digits. That is how JavaScript numbers work, not a bug in this tool, and it is also what will happen when that JSON reaches any JavaScript that parses it. If those ids matter, send them as strings.
Everything happens in your browser. What you paste is never sent to Sellstamp, which is also why there is no size limit beyond what your browser can hold.
Questions
How do I validate JSON?
Paste it here: this is also a JSON validator. If your browser’s own JSON.parse accepts it, it is valid JSON and it is formatted. If not, you get the line, the column and what was expected there.
What are the most common JSON errors?
Things JavaScript allows and JSON does not: a trailing comma, single quotes, unquoted keys, comments, and numbers written as .5 or 01.
Why did my large number change?
Integers above 2^53 lose their last digits when parsed as JavaScript numbers, and 1.0 becomes 1. Send large ids as strings if they must survive exactly.
Does formatting change my data?
Only whitespace, apart from the number normalisation above. Key order and values are kept.
Is my JSON sent anywhere?
No. It is parsed and formatted in your browser, which is also why the only size limit is what your browser can hold.
Related tools
Open Graph preview
A share card, an X card and a Google snippet, plus the tags to paste.JSON to CSV
JSON arrays to spreadsheet-ready CSV.CSV to JSON
CSV rows to typed JSON objects.JSON to YAML
JSON to YAML 1.2.YAML to JSON
YAML to JSON, with error positions.XML to JSON
XML to JSON, attributes and repeats handled.
Popular free tools
QR code generator
Any link or text to a QR code, with a logo in the middle.Background remover
A transparent PNG, cut out without uploading the photo.Invoice generator
Line items, tax and a total, ready to print or save as a PDF.Image resizer
Exact pixels or a percentage, as PNG, JPEG or WebP.Logo maker
A mark, a monogram or a wordmark, as a transparent PNG and an SVG.Profit margin calculator
Cost and price to margin, or a target margin to the price that hits it.