Text Diff Tool

Paste two blocks of text to compare them line by line. Highlights additions, deletions, and unchanged lines instantly.

Unified & split viewIgnore whitespaceNo data stored

What is a Text Diff Tool?

A text diff tool compares two pieces of text and highlights the differences — additions, deletions, and unchanged lines — using colour-coded output similar to the git diffor Unix diff commands. It is an essential tool for reviewing changes in configuration files, code snippets, API responses, or any text where you need to quickly understand what changed between two versions without reading both in full.

Common Use Cases

  • Compare two versions of a config file to find what changed after a deployment
  • Spot differences between two API responses for the same endpoint
  • Review a colleague's code changes before a formal code review
  • Compare translated or edited documents to see what was added or removed
  • Verify that a find-and-replace operation produced the expected changes

How It Works

The diff algorithm (an implementation of the Myers diff algorithm or similar LCS-based approach) computes the longest common subsequence of lines between the two inputs and classifies each line as unchanged, added (green), or removed (red). Line-level diffing is the default; word-level or character-level diffing can highlight more granular changes within a line. All comparison happens in your browser — text is never sent to a server.

Frequently Asked Questions

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

Unified diff shows both versions interleaved in a single column with + and - markers — compact and good for terminals. Side-by-side diff shows the two versions in parallel columns — easier to read for longer files or prose comparisons.

Does whitespace matter in the comparison?

By default, trailing whitespace and line-ending differences (CRLF vs LF) are included in the diff. Most tools offer an "ignore whitespace" option that skips purely cosmetic whitespace changes so you can focus on meaningful content differences.

How large a file can I diff in the browser?

Browser-based diff tools handle files up to a few hundred kilobytes comfortably. For very large files (megabytes), the diff algorithm can become slow due to the quadratic nature of LCS computation. Use command-line tools like diff or git diff for large files.

How it works: This tool uses a Longest Common Subsequence (LCS) algorithm to find the minimal set of changes between two texts — the same technique used by Git and most code review tools to produce line diffs.

All comparison happens locally in your browser. Neither panel's content is sent anywhere.