JSON Formatter
Format, validate and minify JSON online for free - no upload, no sign-up, runs entirely in your browser.
Paste in messy or minified JSON and this tool formats JSON online instantly - pretty-printed, validated, with invalid syntax pointed out at the exact line and column, entirely in your browser.
Nothing you paste or upload is sent anywhere. Formatting, validating and minifying all happen locally in this browser tab.
Note: numbers larger than 253 (for example, some 64-bit IDs) can lose precision, because JSON numbers are parsed as regular JavaScript numbers. See the FAQ below.
Why use this JSON formatter
100% private
Your JSON is never uploaded. Formatting, validating and minifying all happen locally in this browser tab.
Exact error locations
Invalid JSON is reported with the line and column to check, not just a generic error.
Format or minify
Pretty-print for readability, or minify to shrink a file before you send it somewhere.
No sign-up, no limit
Runs instantly in your browser tab. No account, no daily limit, no watermark on the output.
How to format JSON online
- Paste your JSON into the box, or drop a .json file onto it.
- Choose an indent size - 2 spaces is the default.
- Click Format to pretty-print it, or Minify to compact it to one line.
- If it's invalid, fix the problem at the line and column shown.
- Copy the result, or download it as a .json file.
Common JSON formatting problems
- Trailing comma after the last item:
{"a": 1, "b": 2,}is invalid - strict JSON doesn't allow a comma after the final item in an object or array. Remove it. - Single quotes instead of double quotes: JSON requires double quotes for both keys and string values.
{'a': 1}needs to become{"a": 1}. - Unquoted object keys:
{a: 1}is valid JavaScript but not valid JSON - every key needs quotes:{"a": 1}. - Comments left in the file: JSON has no comment syntax. Remove any
//or/* */comments before validating. - NaN, undefined or Infinity used as a value: none of these are valid JSON. Use
null, or represent the value as a string. - A large integer changed after formatting: JSON numbers are parsed as JavaScript numbers, which lose precision above 253. Keep very large IDs as strings if exact precision matters.
- Duplicate keys in an object: JSON.parse silently keeps only the last value for a repeated key. If your data looks like it's missing something after formatting, check for a duplicate key higher up.
Working with the SDP or ICE side of a WebRTC connection instead? Try the SDP inspector or the WebRTC ICE tester. You can also browse all Meetrix features.
Frequently Asked Questions
Is this JSON formatter free?
Yes. It is free to use, requires no sign-up, and there is nothing to install.
Is my JSON data uploaded anywhere?
No. Formatting, validating and minifying all run locally in your browser using JavaScript's own JSON parser. Nothing you paste or upload is sent to Meetrix or anyone else.
Why does it say my JSON is invalid when it looks fine?
The most common causes are a trailing comma after the last item, single quotes instead of double quotes, unquoted object keys, or a comment left in the file - none of these are valid in strict JSON, even though they are common in JavaScript. The error message includes the exact line and column to check.
Can I convert JSON to a single line (minify it)?
Yes, click Minify. It strips all whitespace and produces the same data as compactly as possible - useful for shrinking a file before sending it somewhere with a size limit.
Does formatting change the order of my keys?
No, not unless you turn on Sort object keys. By default, formatting and minifying both preserve your original key order - JSON object key order isn't meaningful to the format, but this tool keeps it stable anyway so a diff against your original stays clean.
Why did a large number change after formatting?
JSON numbers are parsed as regular JavaScript numbers, which lose precision above 253 (about 9 quadrillion). This mostly shows up with 64-bit IDs or timestamps. If exact precision matters, keep that value as a JSON string instead of a number.
Can I format a JSON file, not just pasted text?
Yes. Click Upload file, or drag a .json file directly onto the text box. It loads the file's contents and formats them automatically.
Does this support JSON5, JSONC, or JSON with comments?
No, this formatter validates and formats strict JSON only, the same rules JSON.parse enforces. Comments, trailing commas and unquoted keys will all be flagged as errors rather than silently accepted.
Is there a size limit?
No hard limit, but very large JSON documents (tens of megabytes) may be slow to format in some browsers since it all happens on your device rather than a server.
Which browsers are supported?
Any modern browser: Chrome, Firefox, Edge, and Safari. No special APIs are needed beyond standard JavaScript.
Building something that needs real infrastructure, not just a formatter?
Meetrix builds and debugs meeting, recording and WebRTC infrastructure for teams that have outgrown one-off tools.
Talk to Us