(208) 391-7176
ALCO Tools · Text

JSON formatter and validator

Indent, minify, sort and check JSON, with errors reported by line and column.

Opening tool…

Runs in your browser. Nothing you enter is uploaded to ALCO.

Overview

About this tool.


Paste JSON and get it back correctly indented, minified onto one line, or with every object key sorted alphabetically so two documents can be compared. When the JSON is broken you get the line and column of the problem plus the likely cause — a trailing comma, a single-quoted string, an unquoted key — instead of a character offset you have to count to yourself. The document is parsed in your browser and never sent anywhere, so it is safe to paste an API response that contains customer data.

Common questions

Using this tool.


Why does my JSON fail with a trailing comma?

Because JSON is not JavaScript. Trailing commas, comments, single quotes and unquoted keys are all valid in a JS object literal and all invalid in JSON. The error message names which of these it found.

Does sorting keys change the meaning of my document?

No. Object keys are unordered by definition, so sorting them is safe and makes diffing two documents practical. Array order is data, so arrays are left exactly as they are.

What happens to very large numbers?

Numbers that would lose precision are rejected. Keep large IDs and exact high-precision decimal values in quoted strings so they remain unchanged.

How large a document can it take?

One mebibyte. Formatting runs on the main thread of your own browser, and a larger document would stall the tab on a phone, so the limit is refused clearly rather than hanging.

Need more than a quick tool?

These are free and always will be. If one of them is solving a problem you keep having, the underlying issue is usually worth a conversation.

Interested in

Fields marked “required” must be completed. Prefer to talk? Call +1 (208) 391-7176 or book a call.