Nifty / Tools / JSON

JSON Formatter

Paste JSON to pretty-print it. Comments (JSONC), key order and number literals like 1.0 are kept exactly as written.

json-formatter
JSONDrop a file here
Formatted
Loading…

Runs in your browser. Nothing you paste is uploaded or stored.

How to use the JSON Formatter

  1. Paste your JSON on the left, or drop a .json file there.
  2. Pick 2 spaces, 4 spaces or tabs, and tick Sort keys if you want keys in alphabetical order.
  3. Copy the formatted result. If the JSON is broken, the status line tells you where.

Questions

Is my data uploaded anywhere?

No. The tool runs entirely in your browser. Nothing you paste or drop is sent to a server, logged or stored, so it's safe for API responses, config files and other private data.

Does it keep comments?

Yes. It formats JSON with comments (JSONC, as used in tsconfig.json and VS Code settings) without removing them.

Will it change my numbers?

No. Formatting works on the text, so values like 1.0, 1e3 or very large integers stay exactly as you wrote them instead of being rounded by JavaScript.

What's the difference between a JSON formatter and a JSON beautifier?

None. Both mean pretty-printing JSON with indentation and line breaks so it's easy to read.

Related tools