ToolMill.io

JSON Pretty Print, Minify, and Validate

Format JSON for readability, minify it for compact storage, and validate it before using it in APIs, config files, frontend apps, or test fixtures. This page is designed for day-to-day formatting work: turning one-line payloads into readable structures, shrinking formatted JSON back down, and catching invalid syntax before you reuse the result.

Data

Try it

Examples

Pretty-print JSON
Input
{"user":{"id":123,"name":"Ada"},"roles":["admin","editor"],"active":true,"meta":{"created":"2026-03-05T17:46:39Z"}}
Output
{
  "user": {
    "id": 123,
    "name": "Ada"
  },
  "roles": [
    "admin",
    "editor"
  ],
  "active": true,
  "meta": {
    "created": "2026-03-05T17:46:39Z"
  }
}
Minify JSON
Input
{
  "a": 1,
  "b": [2, 3],
  "nested": {
    "ok": true,
    "note": "hello"
  }
}
Output
{"a":1,"b":[2,3],"nested":{"ok":true,"note":"hello"}}

What pretty print does vs what minify does

Pretty print rewrites valid JSON with indentation and line breaks so nested objects and arrays are easier to scan. Minify removes unnecessary whitespace so the same JSON becomes more compact. Both actions depend on the input being valid JSON first.

This page changes presentation, not meaning. It does not sort keys, repair broken syntax, or validate the payload against a schema. The goal is quick formatting and a fast validity check while you work with pasted JSON text.

When to use each mode

Use Pretty when you are reading a one-line API response, reviewing a nested config snippet, inspecting a copied webhook payload, or comparing the structure of multiple records. Use Minify when you want to shrink readable JSON back down before embedding it in a request body, fixture, environment value, or other compact text workflow.

Step-by-step workflow

Paste JSON into the editor, choose Pretty or Minify, then review the result in the same box. If the text is valid, the page rewrites it immediately. If the parser fails, the error area shows that the input is invalid so you can correct the syntax before trying again.

Common input situations

Typical inputs include single-line API responses, minified config fragments copied from a repo, already formatted JSON that needs to be compacted again, or pasted payloads from logs and browser tools. In each case the useful question is the same: is this valid JSON, and do I want it easier to read or easier to paste into a compact destination?

Troubleshooting invalid JSON

Before You Rely on Reformatted JSON in Another System

Before pasting the result into another app, confirm that the destination accepts the same structure, character encoding, and escaping rules. A clean formatted payload is easier to inspect, but production readiness still depends on the schema or contract expected downstream.

What This Formatter Does Not Validate or Repair

Formatting does not repair schema mismatches, missing required fields, wrong data types, or API-specific expectations. A payload can look cleaner after formatting and still fail in the destination system because the underlying issue was not whitespace or indentation.

How to Interpret Pretty-Printed vs Minified JSON Output

Pretty-printed output expands indentation and line breaks so the structure is easier to inspect, while minified output removes that extra whitespace for compact transport or storage. The data can stay equivalent even though the presentation changes a lot. Choose the result that fits your next step instead of assuming one mode is always better.

Formatting usually fails because the text is not valid JSON. Common causes include trailing commas, missing braces or brackets, single quotes used instead of double quotes, property names without quotes, and copied text that includes comments or extra prose. This page can confirm valid syntax quickly, but it does not auto-repair malformed JSON for you.

Related tools