HTML Runner

JSON Formatter

Indent JSON for review or compact it for transport with a browser-based formatter.

How to use JSON Formatter

Choose two spaces or four spaces for a readable view, or Compact for a single-line result.

Limitations

Parsing uses JavaScript numbers. Large integers can lose precision and duplicate keys collapse to the final occurrence.

Frequently asked questions

Can I format JSON with comments?

Standard JSON disallows comments. Remove them before formatting.

Test your web code in the live HTML workspace.

Related resources