QR Code Generator
Generate QR codes for URLs, text, Wi-Fi credentials, vCards, and more. Customise foreground and background colour, error correction level, margin, and download as SVG or PNG — free and instant.
Format, validate, minify, or sort JSON data with configurable indentation. Instantly check for syntax errors, view node count and nesting depth — free, no sign-up required.
Mode
Indentation
Input JSON
Output
JSON Formatter is part of the Developer collection. If you want a broader view of similar workflows, open the Developer category page or browse all QuickTools categories.
Common next steps after this tool include QR Code Generator, Base64 Encoder / Decoder and UUID Generator.
JSON (JavaScript Object Notation) is the most widely used data-interchange format on the web. It is human-readable but often arrives minified or incorrectly indented, making it hard to audit or debug. This tool parses any JSON input and lets you format, minify, validate, or sort keys in one click — with live statistics including line count, character count, total node count, and maximum nesting depth.
All processing happens server-side via a stateless API. Nothing is stored or logged. The formatted output can be copied to the clipboard or downloaded as a .json file.
formatted.json.Format (Pretty-Print)
Parses the JSON and re-serialises it with consistent indentation. Ideal for reading API responses, reviewing configuration files, or committing readable JSON to version control.
Minify
Strips all whitespace characters (spaces, tabs, newlines) to produce the shortest possible valid JSON string. Use this before embedding JSON in a JavaScript bundle, HTTP request body, or database column to save bytes.
Validate
Parses the input and returns the formatted result if valid, or the exact syntax-error message (with position) if not. Great for catching trailing commas, unquoted keys, or single-quoted strings that are common mistakes.
Sort Keys
Recursively sorts all object keys alphabetically at every nesting level. This creates deterministic output useful for diffing two JSON objects, normalising API fixtures, or making version-control diffs easier to read.
| Type | Example | Notes |
|---|---|---|
| String | "hello world" | Must use double quotes |
| Number | 42 / 3.14 / -7 / 1e3 | No quotes, no leading zeros |
| Boolean | true / false | Lowercase only |
| Null | null | Lowercase only |
| Array | [1, "two", true] | Ordered, comma-separated |
| Object | {"key": "value"} | String keys, comma-separated pairs |
REST API Response
{
"status": "ok",
"user": {
"id": 42,
"name": "Alice",
"roles": ["admin", "editor"]
}
}Format API responses before reading; minify before putting them in cache.
package.json (Node.js)
{
"name": "my-app",
"version": "1.0.0",
"scripts": {
"build": "tsc",
"start": "node dist/index.js"
}
}Validate package.json after manual edits to catch missing commas or mismatched braces.
Minified Payload (before HTTP POST)
{"userId":42,"action":"purchase","items":[{"id":7,"qty":2}]}Minify JSON payloads to reduce HTTP body size and speed up requests.
Under the hood the tool calls JSON.parse() on the raw input. If parsing fails, the native error message (which includes the character offset) is returned immediately. If it succeeds, the parsed JavaScript value is passed to JSON.stringify(value, null, indent) — where indent is 2, 4, or a tab character.
For Sort Keys, the parsed object is recursively traversed and its keys reinserted in alphabetical order before re-serialising. For Minify, JSON.stringify(value) is called without an indent argument, which produces compact output. Statistics (line count, node count, max depth) are computed in a single O(n) tree traversal.
What is the difference between Format and Validate?
Both parse the JSON, so both detect errors. Format produces pretty-printed output; Validate also produces formatted output. In practice they behave identically — Validate mode is labelled to help users whose goal is only to check correctness rather than edit the output.
Why does my JSON fail even though it looks correct?
Common pitfalls: trailing commas after the last array element or object property (not allowed in JSON, only in JavaScript); single-quoted strings (JSON requires double quotes); unquoted property keys; and comments (// or /* */ are not part of the JSON standard). The error message includes the exact character offset.
What does "node count" mean?
Every value in the JSON tree counts as one node — each string, number, boolean, null, array, and object. A node count of 10 means the document contains 10 distinct values. This is useful for estimating document complexity.
What is "max depth"?
Max depth is the number of nesting levels from the root to the deepest child. A flat object like {"a": 1} has depth 1. An object inside an array inside another object has depth 3. Very deep nesting (> 20) can cause stack overflows in some parsers.
Does Sort Keys affect array order?
No. JSON arrays are ordered sequences, so element order is preserved exactly. Only object keys are sorted — objects are unordered by the JSON specification, so sorting is safe.
Can I format very large JSON files?
The tool handles typical payloads (up to a few megabytes) well. For very large files (10 MB+) you may hit request size limits. In those cases use a command-line tool: jq . file.json or python -m json.tool file.json.
Is JSONC (JSON with comments) supported?
Not directly — JSONC is not standard JSON. Strip comments first (e.g. with the "Strip JSON Comments" npm package), then paste the result here.
Generate QR codes for URLs, text, Wi-Fi credentials, vCards, and more. Customise foreground and background colour, error correction level, margin, and download as SVG or PNG — free and instant.
Encode any text to Base64 (standard, URL-safe, or MIME) or decode any Base64 string back to plain text. Instant, free, no sign-up required.
Generate UUID v1, v4, v5, or Nil identifiers in bulk. Validate any UUID and detect its version. Copy instantly — no signup required.
Generate MD5, SHA-1, SHA-224, SHA-256, SHA-384 & SHA-512 hashes from any text. Supports hex, Base64, and Base64URL output, plus HMAC signing. Free and instant.
Convert short MP4, WebM, MOV, AVI, MKV, and other video clips into GIFs online with trim controls, frame-rate options, and private in-browser processing.
Create animated GIFs from a sequence of images online with per-frame delay, output width, loop count, and private in-browser processing — no upload required.
Convert an animated GIF into a compact MP4 or WebM video file online with output width, duration, and FPS controls — processed entirely in your browser, no upload required.
Convert an animated GIF into a compact WebM video file online using VP9 or VP8 — output width, duration, and FPS controls with private in-browser processing, no upload required.