⚡ Free Tool

JSON Formatter, Validator & Comparator

Format, validate, minify and compare JSON instantly — 100% in your browser. Your data never leaves your device.

Indent:
Paste JSON in the input panel to begin
Input JSON
Formatted Output
1
Input Size characters in input
Output Size characters formatted
Keys Found total JSON keys
Nesting Depth levels deep
Paste JSON to minify
Input JSON
Minified Output
1
Original Size before minification
Minified Size after minification
Saved characters removed
Reduction size reduction
JSON A — Original
JSON B — Modified
Click to copy change to B  ·  Click to copy change to A
Diff Result
Added in B
Removed from B
Changed value
Paste two JSON objects above and click Compare JSON to see differences.

What You Can Do

🎨

Syntax Highlighting

Keys, strings, numbers, booleans and nulls are color-coded for instant readability.

Real-time Validation

Errors are caught as you type with precise line and position indicators.

JSON Minification

Strip all whitespace for compact payloads — ideal for APIs and config files.

Compare & Merge

Deep-diff two JSONs side by side. Use merge arrows to apply individual changes.

Sort Keys

Alphabetically sort all JSON keys at every nesting level for consistency.

🔒

100% Private

Your data never leaves your browser. No server uploads, no logging, ever.

How to Use

1

Choose a Tab

Select Format to beautify, Minify to compress, or Compare to diff two JSON objects side by side.

2

Paste Your JSON

Click Paste or use Ctrl+V to paste your JSON. Click Sample to try with example data.

3

Run the Action

Click the action button — or use Ctrl+Enter as a keyboard shortcut on any tab.

4

Copy or Merge

Click Copy Output to copy the result, or use the → ← arrows in Compare to merge individual changes.

Frequently Asked Questions

Yes. Every feature runs 100% in your browser using JavaScript. Your JSON is never sent to any server, making it safe for API keys, config files, and sensitive data.
Formatting (beautifying) adds indentation and line breaks to make JSON readable. Minification strips all whitespace to produce compact single-line JSON, reducing file size for API responses and network transmission.
The comparator does a deep structural diff between two JSON objects. It highlights keys added in B (green), removed from B (red), and keys with different values (yellow). The → and ← merge buttons let you apply individual changes from one side to the other.
Common causes: missing double quotes around keys or strings, single quotes instead of double quotes, trailing commas after the last element, missing closing brackets or braces, and unescaped special characters inside strings.
Yes. The comparator handles both objects and arrays, comparing array elements by index and highlighting additions, removals, and changes.
JSON requires double quotes for all keys and strings, no trailing commas, and no functions or undefined values. It strictly follows RFC 8259. JavaScript objects are more flexible but cannot be directly used as JSON without serialization.

Related Tools