JSON Formatter & Validator
Format, validate, minify, repair and diff JSON instantly. Syntax highlighting, stats panel, file upload and download.
JSON Diff — Compare Two JSON Objects
Paste two JSON strings to highlight line-by-line differences. Both inputs are auto-formatted before comparison.
Key & Path Search
Search for key names or paths in your formatted JSON. Results show the full dot/bracket path to each match.
How to Use the JSON Formatter
Six ways to work with JSON on this tool — each designed to save you time in real development workflows.
.json file from disk, or download the formatted output as a properly named formatted.json file.All Features at a Glance
Everything packed into this free tool — no account, no limits, no ads in the output.
JSON Syntax Cheatsheet
Quick reference for valid JSON — the rules developers most often get wrong.
Frequently Asked Questions
Common questions about JSON formatting, validation, and this tool.
Formatting (beautifying) adds indentation and line breaks to make JSON human-readable. Minifying removes all whitespace to produce the smallest possible string for machine processing. Both represent the same data — only the encoding differs. Use formatted JSON during development and debugging; use minified JSON in production APIs and config files to reduce payload size.
The most common causes are: (1) trailing commas after the last element in an object or array ({"a":1,}), (2) single-quoted strings instead of double quotes ({'key':'val'}), (3) unquoted keys ({key: "val"}), (4) JavaScript comments (// or /* */), (5) undefined, NaN, or Infinity values which are not valid JSON. Use the Auto-Repair button to fix the first three automatically.
Auto-Repair handles the three most common hand-written JSON mistakes: trailing commas ([1,2,] → [1,2]), single-quoted strings ('hello' → "hello"), and unquoted object keys ({name:"val"} → {"name":"val"}). It cannot repair structural errors like mismatched brackets or completely malformed data.
No. All processing happens entirely in your browser using JavaScript. Your JSON data never leaves your device and is never stored or transmitted to any server. This makes the tool safe to use with confidential API responses, configuration data, or private payloads.
JSON (JavaScript Object Notation) is a strict text-based data format derived from JavaScript object syntax, but with important differences: all keys must be double-quoted strings, values can only be strings, numbers, booleans, null, arrays, or objects — not functions or undefined. JavaScript objects are runtime data structures that allow unquoted keys, functions, and special values. JSON is a serialisation format; JavaScript objects are in-memory data.
This browser-based tool handles JSON up to several MB comfortably. For files larger than ~10 MB, browser performance may degrade. For large files: use the file upload button instead of pasting to avoid clipboard limits, use minify mode to reduce output size, or consider command-line tools like jq for gigabyte-scale files.
Sort Keys alphabetically reorders all object keys at every nesting level. This is useful for: comparing two JSON objects that have the same data in different key order, producing deterministic output for version control, and deduplication workflows where key order varies between sources. Array element order is not changed.
Yes — use the JSON Diff section on this page. Paste the first JSON in the "JSON A" box and the second in "JSON B". Both are automatically formatted before comparison so whitespace differences are ignored. Lines shown in green were added in B; lines in red were removed from A; unmarked lines are unchanged.
JSON paths describe the location of a value inside a JSON structure using dot notation for object keys (.name, .meta.version) and bracket notation for array indices ([0], [2]) and keys with special characters (["my-key"]). The path search in this tool shows the full path to every key matching your query, starting from the root $.
Two spaces is the most common convention for JSON (used by npm, package.json, and most style guides). Four spaces is popular in Python-oriented projects. Tabs produce the smallest formatted size since they are one character but visually expand. For files committed to version control, match your project's existing convention to avoid noisy diffs.