JSON minifier / beautifier

Validate, minify, and beautify JSON

Paste any JSON — objects, arrays, or a single value.

Drop a file here

or paste JSON

This tool runs entirely in your browser. Your JSON is never uploaded or sent to a server.

About this tool

JSON (JavaScript Object Notation) is a lightweight text format for storing and exchanging structured data. It's the dominant data format for REST APIs, configuration files, and NoSQL databases. This tool validates that your JSON is syntactically correct, formats it with consistent indentation so it's easy to read, and can minify it back to a compact single-line form for production use or transmission. Validation errors are shown inline so you can pinpoint exactly what's wrong.

Common uses

  • › Formatting API responses for readability during development
  • › Validating JSON config files before deployment
  • › Minifying JSON payloads to reduce request size
  • › Quickly checking whether a string is valid JSON
  • › Cleaning up auto-generated JSON with inconsistent whitespace

Example

Input
{"orderId":4821,"items":[{"sku":"ABC-01","qty":2}]}
Output
{
  "orderId": 4821,
  "items": [
    {
      "sku": "ABC-01",
      "qty": 2
    }
  ]
}

Technical notes

  • › Valid JSON requires double quotes around both object keys and string values — single quotes are not allowed.
  • › JSON does not permit trailing commas or comments, even though both are common in JavaScript.
  • › Numbers cannot have leading zeros, and NaN/Infinity are not valid JSON values.
  • › This formatter validates strict JSON, not JavaScript object literal syntax (JSON5, JSONC, etc.).

FAQ

Is JSON the same as a JavaScript object?

No. JSON is a text format with stricter rules — for example, object keys must be double-quoted strings, and functions or comments aren't allowed. A JavaScript object literal is more permissive.

Why won't my JSON validate?

The most common causes are single quotes instead of double quotes, trailing commas after the last item in an object or array, unquoted keys, or comments — none of which are valid in strict JSON.

What does minifying JSON actually do?

It removes all unnecessary whitespace (spaces, newlines, indentation) while keeping the data identical, producing a smaller payload that's faster to transmit but harder for humans to read.

Related tools