---
title: Diff and Compare Two Documents | Prettify Docs
description: Compare the open document with pasted data. See a text diff with
  word highlighting, or a semantic diff of JSON and YAML. A Pro feature.
url: https://prettify.tools/docs/diff
---

[Docs](https://prettify.tools/docs) / Editing tools

# Diff and compare

Last updated: October 29, 2026

Diff and Compare shows the differences between the open document and another document you paste. It highlights changes down to the word. Diff and Compare is a Pro feature in [Prettify](https://prettify.tools/app/editor). Free users get one try per day.

## Compare two documents

The open document is the first side. You supply the second side by pasting it.

1. Load a document in the editor.
2. Click Diff / Compare in the toolbar, under the Transform group.
3. Paste the data to compare against the current document.
4. Press `Cmd+Enter` (Mac) / `Ctrl+Enter` (Windows, Linux), or click Compare.

Prettify parses the pasted text with the current format. If the text does not parse, Prettify shows the error and does not compare. The result labels the two sides Current and Pasted.

## Text diff and semantic diff

Prettify offers two diff modes.

- Text: compares the two documents line by line. It is available for every format.
- Semantic: compares the parsed data by structure. It is available for JSON and YAML.

Switch modes with the Text and Semantic buttons at the top of the diff.

### Text diff

Text diff has two layouts.

- Split shows the two documents side by side.
- Unified shows one combined column.

Split is the default on wide screens; Unified is the default on a phone. Added and removed lines are colored, and changed words inside a line are highlighted. The header shows counts of added and removed lines.

### Semantic diff

Semantic diff lists each change by its path, such as `users[0].email`. Object keys join with a dot and array positions are in brackets. It marks each entry as added, removed, or changed, and shows the old value next to the new value. Objects are compared without regard to key order, so a reordered object shows no change.

You can export a semantic diff as a JSON Patch (RFC 6902). Use the copy button, or download it as `diff.patch.json`. The patch writes each path as a JSON Pointer, such as `/users/0/email`.

## Move between changes

Step through the changes with the navigation controls, or the keyboard.

- Press `Alt+Down`, or `n`, for the next change.
- Press `Alt+Up`, or `p`, for the previous change.

The header shows the active change, for example `2 of 7`. Prettify shows `No differences found` when the two sides match.

## Related

- [Split view](https://prettify.tools/docs/split-view) to keep two documents open at once
- [History and versions](https://prettify.tools/docs/history)
- [Prettify Pro](https://prettify.tools/docs/pro)

## Try it online

Tool pages for this topic. Each one runs in your browser.

- [JSON Diff](https://prettify.tools/json-diff)

* [PreviousJSON Schema validation](https://prettify.tools/docs/json-schema)
* [Next Split view](https://prettify.tools/docs/split-view)

## Structured data

```json
{
  "@context": "https://schema.org",
  "@type": "SoftwareApplication",
  "name": "Prettify",
  "url": "https://prettify.tools",
  "description": "Multi-format data viewer, editor, and query engine for JSON, YAML, CSV, XML, Mermaid, Markdown, MDX, HTML, and SVG",
  "applicationCategory": "DeveloperApplication",
  "operatingSystem": "Web, macOS, Windows, Linux",
  "offers": [
    {
      "@type": "Offer",
      "price": "0",
      "priceCurrency": "USD",
      "description": "Free tier with core features"
    },
    {
      "@type": "Offer",
      "price": "19.99",
      "priceCurrency": "USD",
      "description": "Pro: lifetime access to all features"
    }
  ],
  "publisher": {
    "@id": "https://prettify.tools/#organization"
  }
}
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "@id": "https://prettify.tools/#organization",
  "name": "Prettify",
  "legalName": "Off Leash Labs",
  "url": "https://prettify.tools/",
  "logo": {
    "@type": "ImageObject",
    "url": "https://prettify.tools/icon-512.png",
    "width": 512,
    "height": 512
  },
  "contactPoint": {
    "@type": "ContactPoint",
    "contactType": "customer support",
    "email": "offleashlabs@gmail.com",
    "availableLanguage": "English"
  }
}
```
