JSON formatter and validator
Indent, minify, sort and check JSON, with errors reported by line and column.
Open this tool
Checking access…
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.
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.
More text tools
Base64 encoder and decoder
Convert text to Base64 and back, with correct handling of accents and emoji.
Open Base64 encoder and decoderText compare
Compare two blocks of text line by line and see exactly what changed.
Open Text compareCase converter
Switch text between sentence, title, camel, snake, kebab and constant case.
Open Case converterNeed 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.