tooloora

JSON Formatter & Validator — local, with error position

Format, minify and validate JSON in your browser. Errors are pinpointed with line, column and a context snippet. Nothing is uploaded.

Runs locally — nothing is uploaded

Runs locally in your browser – your JSON is never sent anywhere.

Format, minify and validate JSON

Paste JSON and get it formatted instantly (2 or 4 spaces or tabs), minified or validated, with optional alphabetically sorted keys. On errors the tool shows line, column and a context snippet with a caret pointing at the exact spot. Everything runs in your browser: no upload, no signup, and it works offline.

Why should JSON never go into an uploading online formatter?

What developers paste into formatters is rarely harmless: API responses containing session tokens, config files with keys, exports full of customer data. Many web formatters transmit every input to their server, and you cannot see what happens to it there. This tool parses strictly locally with JSON.parse, the parser built into your browser. There simply is no server call anyone could intercept.

How does the tool find the error position?

Browsers report JSON errors differently depending on the engine: sometimes with a character position, sometimes with line and column, sometimes only with a text snippet. The tool understands all three formats, converts positions into line and column, and prints the affected line with a ^ pointer underneath. The most common causes: a comma after the last element (forbidden in JSON), single instead of double quotes, unquoted keys, or comments, which JSON does not have.

What counts as valid JSON?

The standard RFC 8259 (December 2017) defines JSON with exactly six structural characters ({ } [ ] : ,), four primitive types (string, number, boolean, null) and two structured types (object, array). Strings require double quotes, comments do not exist, and object keys are unordered by the standard. That is why sorting keys is lossless and useful, for example to diff two JSON documents line by line.

Format or minify, when to use which?

  • Format for humans: code reviews, debugging, documentation. Two-space indentation is the most common style.
  • Minify for machines: smallest transfer size for APIs, configs and storage. The content stays identical, only whitespace disappears.

Honest limits

Above roughly 1 MB of output the display switches to a plain textarea without syntax colors so the page stays responsive. Inputs above roughly 2 MB are not processed at all, so your browser tab cannot freeze. For giant files, use a command-line tool such as jq.

Frequently asked questions

Is my JSON uploaded to a server?

No. Parsing, formatting and validation run entirely in your browser; the tool even works offline. That matters more than it sounds: JSON pasted into online formatters often contains API keys, session tokens or personal data, and many web formatters send everything you paste to their server. Here nothing ever leaves your machine.

What do line and column in the error message mean?

When JSON.parse rejects the input, the tool translates the engine's error into a 1-based line and column plus a context snippet with a caret pointing at the offending spot, so you can jump straight to the problem instead of hunting through the whole document.

What is the difference between formatting and minifying?

Formatting (pretty-printing) adds line breaks and indentation of 2 or 4 spaces or tabs so humans can read the structure. Minifying removes all insignificant whitespace to make the payload as small as possible for transfer or storage. Both produce semantically identical JSON.

Does sorting keys change the meaning of my JSON?

No. RFC 8259 defines JSON objects as unordered collections of name/value pairs, so alphabetical sorting keeps the data equivalent. Only sort if no consumer wrongly depends on key order, and note that duplicate keys are collapsed by the parser (last one wins).

Is there a size limit?

Yes, an honest one: above roughly 1 MB of output the display switches to a plain text area without syntax colors to keep the page responsive, and inputs above roughly 2 MB are not processed at all so the browser tab stays usable. For multi-hundred-MB files a command-line tool like jq is the better choice.