Does this JSON formatter upload my data?
No. Parsing and formatting run in your browser using the built-in JSON parser. The page makes no network request with your input, so payloads containing personal data, order IDs or access tokens never leave your machine.
Why does my JSON fail to parse?
Almost always one of three things: a trailing comma after the last element of an object or array, strings wrapped in single quotes instead of double quotes, or // and /* */ comments. Standard JSON allows none of them. If you copied a JavaScript object literal or a VS Code settings file (which is JSONC), you will hit this.
Should I use 2 or 4 spaces?
It only affects readability, not validity. Two spaces is the common default for JavaScript and TypeScript projects and keeps deeply nested payloads narrow enough to read; four spaces is easier to scan for shallow documents. Pick whichever matches the file you are pasting into.
What does “sort keys” do?
It reorders object keys alphabetically, recursively through nested objects. JSON itself does not define key order and most servers make no guarantee about it, so sorting both sides is the reliable way to make two payloads comparable before you diff them.
Is there a size limit?
There is no hard cap, but everything runs on the main thread in your browser, so very large documents (tens of megabytes) will feel sluggish. For files that big, formatting locally with jq or a code editor will be faster.
Can I format JSON Lines or NDJSON here?
Not directly — JSON Lines is one independent JSON document per line, which is not itself valid JSON. Format a single line at a time, or wrap the lines in an array with commas between them first.