JSON format / validate
Parse, validate and pretty-print JSON, with a clear parse-error message if it is broken. Runs on your device.
Runs on your device. The file is never uploaded.
JSON format / validate parses a document, then prints it back indented, with indent at 2 spaces by default and 4 or tab available. Sorting keys alphabetically at every level is off until you switch sortKeys on. Numbers go through JavaScript, so an integer larger than 2 to the 53 does not come back intact.
Questions
What does it do with broken JSON?
It refuses and shows you why. The text is run through the standard JSON parser, and if that fails the tool reports "invalid JSON:" followed by the parser message, which usually names the position of the problem. Nothing is guessed at or repaired.
What are the options?
Two. Indentation is 2 spaces by default and can be 4 or a tab. Sort object keys is off by default; turn it on and every object at every level has its keys sorted alphabetically, arrays keep their order. The result is always pretty-printed with a trailing newline.
Does it accept comments or trailing commas?
No. It parses strict JSON, so a JSONC or JSON5 file with comments, trailing commas, single quotes or unquoted keys is rejected as invalid, with the parser message telling you where. Strip those first if you are formatting a config file that allows them; the tool refuses the document rather than repairing it.
What happens to duplicate keys?
The last one wins, silently. That is how JSON parsing works, so an object with the same key twice comes out with a single copy of it and no warning. If duplicates matter to your data, check for them before formatting.
Will it change my numbers?
It can. Values pass through JavaScript numbers, so an integer beyond 2 to the 53 loses precision, 1.0 comes back as 1, and 1e3 comes back as 1000. Text and structure are untouched; only the way numbers are written can change.
Can I format several files at once?
Yes, drop as many as you like and each gets its own result block with its own Copy button. All of it runs in a Web Worker on your device, so an unreleased config or a payload with real customer data never leaves the tab. The same indentation and sorting options apply to every file in the batch.