OpenToolbox

Free JSON Formatter

JSON Formatter validates, beautifies and minifies JSON, giving the line and column of the first syntax error and counting any others, so you can jump straight to it. Format with 2 spaces, 4 spaces or tabs, sort keys, browse a tree view and copy any value's path. Big numbers keep their exact digits, and JSONC comments can be allowed.

Indent:
2 spaces, 4 spaces or tabs
Errors:
Line and column of the first error
Numbers:
Big numbers kept exactly
Price:
Free
Runs:
Locally, in your browser
Uploads:
None: files never leave your device
Account:
Not needed

Quick answers

Is my JSON uploaded?

No. Parsing, formatting and validation all run in your browser, so even confidential data stays on your device.

Will big numbers lose precision?

No. Numbers are kept exactly as written, so IDs like 9007199254740993 or prices like 1234.50 are not rounded or changed.

Loading tool…

Processed on your device: your files are never uploaded. How it works

How to use the JSON Formatter

  1. Paste JSON, open a .json file or load the sample.
  2. Errors are flagged live with their line and column: click “Go to error” to jump there.
  3. Press Format (2 spaces, 4 spaces or tabs), Minify or Sort keys, then copy or download the result.
  4. Explore the structure in the Tree panel and copy the path of any value.

Credits & open source

Our own code plus open-source libraries. Thank you to the people who make these projects.

  • CodeMirror 6Code editor with syntax highlighting. © Marijn Haverbeke and others · MIT
  • @uiw/react-codemirrorReact wrapper for CodeMirror 6. © Kenny Wong (uiwjs) · MIT
  • jsonc-parserFault-tolerant JSON scanner that reports error positions. © Microsoft Corporation · MIT
  • lossless-jsonJSON parsing that keeps big numbers exact. © Jos de Jong · MIT

Web platform APIs used: File API, Clipboard API, TextEncoder.

Full license texts: third-party notices · all credits

Frequently asked questions

Can it read JSON with comments?

Yes. Turn on “Allow comments & trailing commas” to accept JSONC files such as tsconfig.json or VS Code settings. Formatting outputs standard JSON without the comments.

Is there a size limit?

No fixed limit: files of several megabytes work fine. Very large files are only limited by your device's memory.

Recommended

Sponsored · we may earn a commission · details

More developer tools tools