JSON Formatter
Pretty-print, minify and fix JSON with exact error locations.
Try before you buy.
- Free preview: the first lines of the formatted or minified JSON (up to 20), with every syntax check, warning and size.
- Locked until you unlock it: download and copy.
- Unlock: Pro pass, ₹179 for 30 days or ₹79 for 1 week, a one-time payment unless you choose automatic renewal. Unlock: Pro pass, $5.99 for 30 days or $2.99 for 1 week, a one-time payment unless you choose automatic renewal.
Ways to unlock shows how to get the full result.
Printing this result is locked in the free preview.
Locked in the free preview. Opens the ways to unlock this result.
Locked in the free preview. Batch runs unlock with a pass.
Locked in the free preview. Query results unlock with a pass.
About the JSON Formatter
Paste JSON from an API response, log file or config and get it neatly indented in one click — or minified onto a single line for sending over the wire.
If the JSON is broken, the formatter points to the exact line and column and explains the problem in plain words ("Trailing comma is not allowed before '}'"), so you can fix it quickly. Numbers are kept exactly as written: large IDs like 12345678901234567890 do not lose precision the way they do with JSON.parse.
Without a pass you see a free preview: every syntax check, warning and size, with the first lines of the formatted JSON. A Pro pass unlocks the whole result, with Copy and Download.
How to use it
- Paste or type JSON into the input box, or use Open file to load a
.jsonfile from your device. - Choose the indentation (2 spaces, 4 spaces or tabs) and, if you like, turn on Sort keys.
- Press Format (or Ctrl/⌘ + Enter) to pretty-print, or Minify to remove all whitespace.
- With a pass, or after unlocking this result, copy it or download it as a
.jsonfile; the free preview shows its first lines.
Examples
{"id":7,"name":"Asha","roles":["admin","editor"],"active":true}{
"id": 7,
"name": "Asha",
"roles": [
"admin",
"editor"
],
"active": true
}{
"a": 1,
"b": 2,
}Line 4, column 1: Trailing comma is not allowed before '}'
Remove the comma after 2 and the JSON becomes valid.
Common uses
- Reading minified API responses while debugging.
- Cleaning up configuration files (package.json, tsconfig.json, app settings) before committing.
- Minifying JSON payloads to reduce request size.
- Producing stable, sorted output so that diffs between two versions are easy to read.
What counts as valid JSON
JSON is stricter than JavaScript. Property names and strings must use double quotes, trailing commas are not allowed, and comments are not part of the format. The only literal values are true, false and null (lower case). Numbers cannot have leading zeros, a leading +, or be NaN/Infinity.
This formatter follows RFC 8259 exactly, so anything it accepts will be accepted by any standards-compliant parser.
Limitations
- Very large documents (tens of megabytes) are formatted in your browser and may take a few seconds on older phones.
- Comments and trailing commas (JSON5/JSONC) are reported as errors rather than silently removed, because standard parsers reject them.
Privacy
On this device: nothing is sent
Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.
Frequently asked questions
What do I get without a pass?
Without a pass, JSON Formatter shows the first lines of the formatted or minified JSON (up to 20), with every syntax check, warning and size. Until you unlock it, the result can’t be downloaded or copied. A Pro, Premium or Ultimate pass, a one-time payment unless you choose automatic renewal, unlocks the full result. The pricing page lists the passes and their prices.
Is my JSON sent to a server?
No. Formatting and validation run entirely in your browser. You can even disconnect from the internet after the page loads and it will keep working.
Why does my number change in other formatters but not here?
Most online formatters use JSON.parse, which converts numbers to 64-bit floating point and loses precision beyond 15–17 significant digits. This tool keeps every number exactly as you typed it.
What does "Sort keys" do?
It orders the properties of every object alphabetically (by Unicode code point). Arrays keep their order because the position of array items is meaningful.
What happens to duplicate keys?
They are kept in the output, and the tool warns you about them. Most parsers keep only the last value for a duplicated key, which is usually a bug.
Learn more
Lessons on MySmartCoPilot Learn that use this tool:
- Dictionaries: keys, values and views Free
- A tour of the Python standard library Free lesson, Pro answers
- JSON: load, dump and custom types Free lesson, Pro answers