tools / json fmt

JSON Formatter

A JSON formatter that beautifies, minifies, and validates JSON instantly. Everything runs in your browser — your data never leaves your device.

Input
Output

Beautify vs. minify: what's the difference?

Beautifying (also called "pretty-printing") takes compact JSON and reformats it with consistent indentation and line breaks so a human can actually read the structure — useful when you're debugging an API response or inspecting a config file. Minifying does the opposite: it strips all whitespace, producing the smallest possible payload. The data is identical either way; only the formatting changes.

When to minify vs. when to beautify

  • Minify before shipping JSON in production API responses or bundled config files — smaller payloads mean faster network transfer
  • Beautify when you're reading logs, debugging a response body, or reviewing a file in version control where diffs matter
  • Validate whenever you're not sure the JSON is well-formed — catching a syntax error here is faster than chasing a cryptic parser error deep in your app

Frequently asked questions

What's the difference between minify and beautify?

Beautify reformats JSON with 2-space indentation and line breaks so it's easy to read and diff. Minify removes every unnecessary space, tab, and newline to shrink the file size. Both produce functionally identical JSON — only the whitespace changes.

Why does my JSON fail to validate?

The most common causes are a trailing comma after the last item in an object or array, using single quotes instead of double quotes around strings and keys, unquoted object keys, or a missing closing brace or bracket. The validator's error message includes the position where parsing failed, which is usually right at or just after the actual problem.

Does JSON support comments?

No. The JSON spec has no comment syntax, so // or /* */ in a JSON file will always fail to parse. If you need comments, use a superset format like JSON5 or JSONC, or strip them before parsing.

Is my JSON data uploaded when I use this tool?

No. Parsing, beautifying, minifying, and validating all happen instantly in your browser using the built-in JSON object — nothing is sent to a server.