Text Diff Tool

Paste two versions of a text to instantly see what changed — additions highlighted in green, deletions in red. Switch between side-by-side and unified views, and copy the diff output as plain text or a patch file.

Link copied to clipboard

Original

Modified

How to use this tool

  1. Paste your original text into the left panel.
  2. Paste the modified version into the right panel.
  3. The diff appears immediately below — additions are highlighted in green and deletions in red.
  4. Switch between Side-by-Side (two columns) and Unified (single column with +/- prefixes) views using the toggle.
  5. Use the Copy buttons to export the diff as plain text or as a standard unified patch (`.patch`) format.

Why use our Text Diff Tool?

Whether you are reviewing changes to a configuration file, comparing document revisions, or spotting what changed between two API responses, a diff tool saves time and prevents errors. This tool runs entirely in your browser — your text is never sent to a server — and updates in real time as you type.

Frequently Asked Questions

What does a text diff tool do?

A diff tool compares two pieces of text and highlights the differences between them. Lines that exist only in the original are shown in red (deletions), lines that exist only in the modified version are shown in green (additions), and unchanged lines are shown in grey. The name comes from the Unix `diff` command, which has been used by developers to compare files since the 1970s.

What is the difference between side-by-side and unified diff views?

Side-by-side view displays the original and modified texts in two columns, with changed lines aligned horizontally so you can read both versions at a glance. Unified view shows both versions in a single column: deleted lines are prefixed with `-`, added lines with `+`, and unchanged lines with a space. The unified format is also the standard format for `.patch` files used in version control systems like Git.

What is a patch file and when would I use it?

A patch file (`.patch`) contains a diff in the unified format that can be applied to a file to transform it from one version to another. Developers use patch files to share code changes without sending the entire modified file. You can apply a patch using the `git apply` or `patch` command in your terminal.

Is my text sent to a server?

No. All comparison happens entirely in your browser using JavaScript. Nothing you paste into this tool is ever transmitted to our servers or stored anywhere.

What kinds of content can I compare with this tool?

You can compare any plain text — source code, configuration files (YAML, JSON, TOML, .env), log files, prose documents, CSV data, SQL queries, or any other text-based content. The tool compares line by line, so it works best when the content is structured with meaningful line breaks.