Format JSON online
Turn cramped, single-line JSON into something a person can actually read — or the other way round, when what you need is the smallest possible file. Add your file, choose a mode, and download the result.
Formatting only changes whitespace. The data itself — every key, value, and array — comes out exactly as it went in, so this is safe to run on a config file, an API response you saved, or anything else where correctness matters.
Your file never leaves your device. Parsing and formatting run entirely in your browser, so nothing is uploaded, stored, or scanned.
or drop them here — nothing is uploaded
How to json formatter
Add your JSON file
Drop one or more .json files into the box, or click to browse.
Choose pretty print or minify
Pretty print spaces the file out for reading, with a choice of 2 spaces, 4 spaces, or a tab. Minify strips every unnecessary character for the smallest file size.
Format and download
Press JSON Formatter. Each file downloads with the same data, reformatted.
Frequently asked questions
Is my file uploaded anywhere?
No. Parsing and formatting run in your browser using JavaScript, so your file stays on your device. You can confirm this by opening your browser devtools Network tab while working — there are no upload requests.
Does formatting change my data?
No. Only whitespace changes — indentation, line breaks, and spacing. Every key, string, number, and array comes out with the exact same values it went in with, in the same order unless you turn on key sorting.
What does sorting keys do?
It reorders the keys of every object in the file alphabetically, at every level of nesting. Array order is never touched — only object keys are sorted, since arrays are ordered data and reordering them would change what the file means.
My file fails with "is not valid JSON" — why?
The file has a syntax error somewhere — a missing comma, an unquoted key, a trailing comma before a closing brace, or similar. The error message includes what the parser found, which is usually enough to locate the problem; JSON is stricter than JavaScript object literals, so files copied from JS source often need small fixes.
Is there a limit on how many files?
Twenty at a time, which is a limit of your device rather than our policy — everything is held in memory while it works.
Can I format XML instead?
That is XML Formatter, a separate tool built for that format.