Paste your JSON. It’s tidied up and checked as you type, on your device.
0 characters · 0 lines
Indent
Result
Your result will appear here.
0 characters · 0 lines
What it does
JSON from an API, a log or a config file often arrives on one long line, or with a mistake that’s hard to spot. This tool reads it as strict JSON and gives it back tidied up:
Indent puts each value on its own line with 2 spaces, 4 spaces or tabs per level. Minify removes every space and line break, for the smallest file.
Sort keys A–Z orders the keys of every object, ignoring case, so two versions are easier to compare.
Checking happens as you type. If the JSON isn’t valid, you see the line and column of the first problem, and your input stays as it was.
Keys, strings and numbers are coloured in the result, and numbers and escapes stay exactly as written.
How to use it
Paste or type JSON into “Your text”. Select “Try a sample” to see an example order record.
Choose an indent, or Minify, and turn on Sort keys A–Z if you want it. The result updates as you type.
Select Copy to put the result on your clipboard, or Download JSON to save it as a .json file.
Good to know
The limit is 2,000,000 characters at a time, nested up to 1,000 levels deep.
Results longer than 50,000 characters are shown without colours, so the page stays quick; Copy and Download work the same.
The counts under each box show characters and lines before and after formatting.
Privacy
Your JSON is processed on your device: formatting and checking run in your browser, and nothing you paste is uploaded or saved.
Frequently asked questions
What makes JSON invalid?
The usual causes are a missing comma between two values, a missing or extra bracket, a key without double quotes, a string in single quotes, or a stray character after the end. When the JSON isn't valid, the tool shows the line and column of the first character that doesn't fit, so you know where to look.
Can I use comments or trailing commas?
Not in JSON. The JSON standard (RFC 8259) has no comments, and a comma after the last item of an object or array isn't allowed. Some tools accept them as JSON5 or JSONC, but most programs reading JSON don't, so this tool reports them as errors. Remove the comment or the last comma and the JSON is valid.
Does sorting the keys change my data?
No. Sort keys A–Z only changes the order of the keys inside each object, which JSON doesn't give any meaning to. Values, arrays and the order of array items stay exactly as they were. Sorting makes two versions of a file easier to compare.
Are large numbers kept exactly?
Yes. Many JSON tools read numbers with JavaScript's number type, which rounds whole numbers above 9,007,199,254,740,991 and drops digits from long decimals. This tool keeps every number, string escape and duplicate key exactly as written; only the spaces and line breaks change.
Is my JSON sent anywhere?
No. Formatting and checking run in your browser, on your device. Nothing you paste is uploaded or saved, so the tool is safe to use with API responses and config files.