Handy Web Tools

Free browser tools with no sign-up

FREE TOOL

JSON Formatter & Validator

Format, minify, validate, open, and download JSON with configurable indentation.

Loading tool…

About JSON Formatter & Validator

Format JSON with two spaces, four spaces, or tabs, or minify it in one click. Syntax errors include a line and column when available, and you can open and save JSON files locally.

How to use

  1. 1.Paste JSON or open a JSON file from your device.
  2. 2.Choose indentation, then format or minify to validate it.
  3. 3.Copy the result or download it as a JSON file.

Useful for

  • Formatting and minifying API responses
  • Validating configuration files
  • Opening, checking, and saving JSON files

Verified examples and scope

These examples describe reproducible behavior in this tool. They are not a guarantee for inputs outside the documented scope.

Input or settingExpected resultCondition
{"name":"Alice","active":true}JSON formatted with two spaces, four spaces, or tabsThe tool does not intentionally reorder keys or coerce value types.
{"items":[1,2,]}A JSON syntax errorA trailing array comma is not valid JSON.

Known limitations

  • Comments, trailing commas, NaN, Infinity, and other non-JSON syntax are rejected.
  • Opened JSON files are limited to 5 MB.

If the result is unexpected

  • If no error line and column are shown, the browser-provided parse error did not include a source position.

How it works

Validation uses JSON.parse; formatting and minification use JSON.stringify.

The tool handles values in the JSON syntax described by ECMA-404.

Pasted JSON and opened file contents are processed in the browser.

Input examples

  • {"name":"Handy Web Tools","active":true}
  • [{"id":1},{"id":2}]

Notes and limitations

  • Comments, trailing commas, and single quotes are not valid standard JSON.
  • Files are limited to 5 MB. When handling sensitive data, also consider the security of your device and browser.

Frequently asked questions

Can it detect invalid JSON?

Yes. The tool reports the line and column of a syntax error when that location is available.

Can I minify and download JSON?

Yes. You can remove unnecessary whitespace and download the result as a JSON file.

Is JSON uploaded to a server?

No. Formatting and validation run in your browser. You should still make sure your own device and browser environment are secure.