JSON Diff
Compare two JSON documents structurally
See exactly which keys and values were added, removed or changed between two JSON documents, ignoring key order and formatting.
- JSON
- Diff
- Compare
How to use JSON Diff
- Paste the original document into Left JSON and the changed one into Right JSON, or drop a file on either box. Try an example loads a sample pair.
- Read the summary badges (added, removed, changed, unchanged) and browse the differences in the Tree view, or switch to List for one line per changed path.
- Tick Ignore array order to match array items by content, Compare numbers by value (1 = 1.0) to treat equal numbers as the same, and list keys to skip in Ignore keys, separated by commas.
- Use Copy as JSON for a list of the changes, or Copy JSON Patch for an RFC 6902 patch that turns the left document into the right one.
How it works
Both documents are parsed with the same strict parser as the JSON Formatter, which keeps numbers and strings exactly as written, then compared as trees. Objects are matched key by key, so key order and whitespace never count as differences, and strings are compared after their escapes are decoded.
Arrays are compared in order by default. Equal items at the start and end are matched first, then the rest is aligned with a longest-common-subsequence match on each item’s content, so inserting one item doesn’t make every later item look changed. Unmatched items at the same spot are paired up and diffed, so an edited object inside an array shows as a change to its fields. With Ignore array order, items are matched by content wherever they are.
Each change is shown with its JSONPath, such as $.users[2].name. The JSON Patch uses JSON Pointer paths (RFC 6901) and add, remove and replace operations. Everything runs on the page in your browser.
Limits
- Each side can be up to 5,000,000 characters (about 5 MB).
- Strict JSON only: comments, trailing commas and other JSON5 features are reported as parse errors, with line and column, for the side they’re on.
- For very long arrays (when the differing middle parts multiplied together exceed 4,000,000 items), items are compared by position instead of being aligned.
- The List view shows the first 1,000 changes and the tree shows 300 children at a time (Show more loads the next ones). Copy as JSON always includes every change.
- If an object has duplicate keys, only the last value is compared, as with
JSON.parse. Extremely deeply nested documents can’t be compared and show an error. - With Ignore array order, the JSON Patch keeps the left document’s item order, so applying it gives an equivalent document rather than one with the right side’s order.
Privacy
Both documents are compared in your browser and never uploaded or stored. Copy share link puts both documents and the options in the link’s # fragment, which browsers don’t send to servers; links are limited in size, so large documents show Too large to share. JSON sent here from another tool with Send to… goes into the left side through this tab’s session storage and is removed as soon as it is read.
Frequently asked questions
Why is 1.0 reported as different from 1?
By default numbers are compared by their exact text, so formatting changes are visible. Turn on Compare numbers by value (1 = 1.0) to compare them as numbers instead. This is exact for any size, so 1e2 equals 100 and big IDs aren’t rounded.
How do I skip timestamps or other fields that always change?
Type their key names in Ignore keys, for example updatedAt, etag. Matching keys are skipped at every depth.
What does the JSON Patch do?
It is a list of RFC 6902 operations that, applied to the left document, produce the right one. You can use it with any JSON Patch library, for example to send only the changes to an API that accepts application/json-patch+json.
Does key order or indentation matter?
No. Objects are compared key by key and whitespace is ignored, so reordering keys or reformatting a document produces no differences.
Why did a removed array item show up as a change?
When items are removed and added at the same spot, they are paired and compared, so an edited object or array shows only the parts that changed. Paired plain values, or values of different types, show as one changed value.
More tools
- Clean Image: Inspect and remove hidden image metadata
- JWT Decoder: Decode and verify JSON Web Tokens
- Diff Checker: Compare two texts line by line
- JS Runner: Run JavaScript and TypeScript in your browser
- JSON Formatter: Format, validate and minify JSON
- Encode / Decode: Base64, URL, HTML entity and hex
- Hash Generator: MD5, SHA and HMAC of any text
- UUID Generator: Generate UUID v4 and v7 in bulk
- Timestamp Converter: Unix time ↔ human dates
- Regex Tester: Test regular expressions live
- URL Parser: Break a URL into its parts
- HTTP Status Codes: Look up any HTTP status code
- MIME Type Lookup: File extension ↔ MIME type
- Password Generator: Strong random passwords and passphrases
- Random String Generator: Random tokens, IDs and keys
- Slug Generator: Turn titles into URL slugs
- Case Converter: camelCase, snake_case, Title Case and more
- Word Counter: Count words, characters and reading time
- JSON to TypeScript: Generate TypeScript types from JSON
- JSON to SQL: Turn JSON arrays into SQL inserts
- YAML ↔ JSON: Convert between YAML and JSON
- XML ↔ JSON: Convert between XML and JSON
- CSV ↔ JSON: Convert between CSV and JSON
- CSV Viewer: View, sort and filter CSV files
- SQL Formatter: Format and beautify SQL queries
- cURL ↔ Fetch: Convert cURL commands to fetch and back
- Markdown Editor: Write Markdown with a live preview
- Text Cleaner: Remove duplicate lines, empty lines and extra spaces
- Find & Replace: Find and replace in any text
- Cron Expression Builder: Build and explain cron schedules
- User-Agent Parser: Identify browser, OS and device from a user agent
- HTTP Headers Inspector: Paste response headers and get them explained
- JWT Generator: Create and sign test JSON Web Tokens
- Certificate Inspector: Decode PEM certificates and keys
- Meta Tag Inspector: Check a page's SEO and social tags
- UTM Builder: Build campaign URLs with UTM parameters
- URL Cleaner: Strip tracking parameters from links
- Robots.txt Generator: Create and test a robots.txt file
- Sitemap Generator: Create an XML sitemap from a list of URLs
- Image Compressor: Shrink JPEG, WebP and AVIF images in your browser
- Image Resizer: Resize images by pixels, percentage or to fit a box
- Image Converter: Convert between PNG, JPEG, WebP and AVIF
- Image to Base64: Encode images as Base64 data URIs and decode them back
- SVG Optimizer: Minify and sanitize SVG files
- Favicon Generator: Make favicon.ico, Apple and Android icons from an image or emoji
- Color Converter: HEX, RGB, HSL, OKLCH and contrast checks
- Number Base Converter: Binary, octal, decimal, hex and float bits
- IP / CIDR Calculator: Subnets, masks and IP ranges for IPv4 and IPv6
- JSONPath Query: Query JSON with JSONPath expressions
- JSON Schema Validator: Validate JSON against a schema, or generate one
- Semver Checker: Check versions against semver ranges
- chmod Calculator: Unix permissions: rwx ↔ octal
- .env Diff: Compare and validate .env files
- TOTP Generator: Generate and verify 2FA codes
- String Escaper: Escape and unescape strings for any language
- Unicode Inspector: See every character, code point and hidden symbol
- Mock Data Generator: Generate realistic fake data
- QR Code Generator: Create QR codes for links, Wi-Fi and contacts
- Lorem Ipsum Generator: Placeholder text in paragraphs, sentences or words
- Date Calculator: Date differences, business days and durations
- Unit Converter: Convert bytes, lengths, weights, temperatures and more
- Query CSV with SQL: Run SQL queries on CSV files
- PDF Merge & Split: Merge, split, reorder and rotate PDFs
- PDF Metadata Cleaner: See and remove hidden PDF metadata
- Office Metadata Cleaner: Remove author and revision data from Word, Excel and PowerPoint
- Images to PDF: Combine images into one PDF
- Image Editor: Crop, rotate, resize and adjust images
- Encrypt / Decrypt Text: Encrypt text with a passphrase (AES-GCM)
- SSH Key Generator: Generate Ed25519 and RSA SSH keys locally
- Email Header Analyzer: Trace an email's path and check SPF, DKIM and DMARC
- JSON to Code: Generate Go, Python, Rust, Java, C# and Kotlin models from JSON
- docker run ↔ Compose: Convert docker run commands to docker-compose and back
- Color Palette Extractor: Pull the dominant colours out of any image
- Password Strength Checker: How long would your password take to crack?
- SPF / DKIM / DMARC Checker: Validate and explain email DNS records
- Kubernetes YAML Checker: Validate and explain Kubernetes manifests
- .gitignore Generator: Build a .gitignore from presets
- CSP Builder: Build and check a Content-Security-Policy
- JSON-LD Generator: Create schema.org structured data
- Open Graph Image Generator: Make 1200×630 social preview images
- CSS Generator: Gradients, shadows, clamp() and more
- Time Zone Meeting Planner: Find meeting times across time zones