WEB TOOLS

JSON Formatter & Validator

Format, validate, and minify JSON directly in your browser.

Your input is not sent to a server. All processing is performed locally in your browser.

Actions

.json (UTF-8, up to 2 MiB)

Format and validate JSON

Validate JSON syntax locally in your browser, then create either a readable indented version or a compact version without insignificant whitespace.

When this tool is useful

Use this tool to inspect API responses or configuration files, and to locate JSON syntax errors. Minify parses and rewrites JSON, so unusually large integers or duplicate object keys may not be preserved exactly.

How to use

  1. Enter or paste JSON, or select a UTF-8 .json file (up to 2 MiB).
  2. For formatting, choose 2 spaces, 4 spaces, or a tab for indentation.
  3. Choose Validate to check syntax without changing the formatted or minified output.
  4. Choose Format or Minify. Changing indentation after formatting requires formatting again.
  5. If a syntax error appears, go to the reported location when available.
  6. Copy the current result or save it as a .json file. Outdated results cannot be copied or saved. You can undo Clear All within 10 seconds.

Processing

JSON.parse validates the syntax and JSON.stringify formats or minifies the result. Your input and selected files are not sent to a server.

Large integers, high-precision decimals, and duplicate object keys can lose information during rewriting. The tool warns when it detects these risks, but does not guarantee preservation of all numeric spelling or property order.

Input is limited to two million characters. Longer content is processed in a Web Worker so edits can discard old results. Browsers without Worker support cannot process longer inputs.

FAQ

What happens when the JSON is invalid?

Syntax errors do not produce a result. The tool shows an approximate line and column when available, and uses a separate message for processing failures.

What do numeric or duplicate-key warnings mean?

Formatting or minifying may change a value or drop earlier duplicate-key values. Compare the input and output, and keep the original if exact preservation is required.

Can I minify JSON?

Yes. Minify parses the JSON and writes a compact representation. The original text and certain numeric representations may not be preserved exactly.

Can I change the indentation?

Yes. Choose 2 spaces, 4 spaces, or a tab. Reformat after changing the setting; minified output does not depend on indentation.

How is Validate different from Format?

Validate checks JSON syntax without rewriting the output. It is not a JSON Schema validator.

Can I undo Clear All?

Yes, within 10 seconds if you have not started editing or another operation.

Can I import or save a JSON file?

You can open UTF-8 .json files up to 2 MiB. Validate the JSON after loading. The current formatted or minified result can be saved to a .json file.

Is my input sent to a server?

No. Validation, formatting, and minification all take place locally in your browser.