JSON Format / Minify

Format, minify and validate JSON.

Runs locally in your browser by default; no upload.

ToolHub ProRemove ads and unlock one-click file export on text-output tools below (image tool keeps its own download).

Unlock Pro on this tool

Batch format/minify (per line) · One-click export download

Get Pro →
Input
Batch format/minify requires Pro. See pricing
Output

You may also need

About

Pretty-print or minify JSON instantly, with syntax validation. This is useful when debugging API responses, cleaning up config files, or preparing compact payloads for logs and tickets. Everything runs locally in your browser by default.

Use cases

  • Inspect and reformat a large API response before sharing it in an issue.
  • Minify JSON to reduce payload size for copy/paste into CLI tools or docs.
  • Validate JSON before committing it to a config repository.

Common pitfalls

  • Many “JSON” snippets online are actually JavaScript objects (single quotes, trailing commas). Convert to strict JSON first.
  • If you paste logs that contain multiple JSON objects, wrap them into an array or extract a single object before formatting.
  • If values appear to change, it’s usually because the input wasn’t strict JSON (or got edited) rather than the formatter changing semantics.

Examples

Input

{"a":1,"b":[2,3]}

Output

{
  "a": 1,
  "b": [
    2,
    3
  ]
}

FAQ

Why is my JSON invalid?

Common causes are trailing commas, missing double-quotes, or JSON-like formats (JS objects, comments, single quotes). Convert it to strict JSON first.

What’s the difference between “format” and “minify”?

Format adds indentation and newlines to improve readability; minify removes whitespace to make the output compact.

Will this upload my JSON?

No. Formatting and validation happen locally in your browser.

Why do numbers/booleans look different after formatting?

Formatting doesn’t change values, but it may normalize spacing. If values changed, your input likely wasn’t strict JSON.

Limitations

  • Only accepts strict JSON (no comments, trailing commas, or single quotes).
  • For extremely large inputs, your browser may slow down due to memory limits.

Recommended

Affiliate slots. Configure real links via environment variables.

No recommendations configured.