◆ DEVELOPER

JSON formatter & validator

Format it, check it, shrink it, sort it. When it is broken you get a line and a column, not a character offset.

JSON.parse fails with "Unexpected token } at position 4127", which is no help at all in a large file. This tool turns that offset into a line and column, prints the offending line and points straight at the character. Everything runs on your device — worth knowing, since the JSON people paste into formatters is usually a live API response.

Input
Output
Or drop a .json file read on your device, not uploaded

Questions people ask

Why is the error message better here?

Because JSON.parse reports a character offset, which is useless in a four-thousand-line file. This tool converts that offset into a line and column, prints the line it happened on, and puts a caret under the exact character.

Is my JSON uploaded?

No. Parsing, formatting and minifying all happen in your browser, and the uploads counter in the top bar stays at 0. That matters here: the JSON people paste into formatters is usually a real API response, complete with tokens and customer records.

What does "sort keys" do?

It sorts every object's keys alphabetically at every level, which makes two JSON documents comparable in a diff. Array order is deliberately left alone, because in JSON the order of an array is meaningful data.

How large a file can it take?

As much as your browser's memory allows, typically tens of megabytes. Because the work happens on your machine there is no server-side size cap and no paid tier for bigger files.

Does it work offline?

Yes. Once the page has loaded it keeps working with no connection.

How this works & why it’s private

This is the browser's own JSON.parse and JSON.stringify, wrapped in better error reporting and a few conveniences. When parsing throws, the character offset in the error message is converted to a line and column by counting newlines up to that point, so you get told where the problem actually is. Nothing is transmitted at any stage — no server sees your payload, which is the only sensible design for a tool people paste production data into. Open your dev-tools Network tab and watch while you use it.