Compare two texts and highlight differences.
Compare two text documents and highlight differences.
A text diff is a side-by-side comparison of two blocks of text that highlights exactly what changed between them. Additions are shown in green, deletions in red, and unchanged sections stay neutral — so you can see at a glance what was added, removed, or modified without reading both versions line by line.
Diffing is one of the oldest and most useful tools in computing. It powers version control systems like Git, code review tools like GitHub and Bitbucket, document comparison features in Google Docs and Microsoft Word, and file sync utilities like rsync and Dropbox. Whenever two versions of something need to be reconciled, a diff algorithm is doing the work behind the scenes.
At its core, a diff algorithm solves the longest common subsequence (LCS) problem: given two sequences, what's the longest chain of items that appears in the same order in both? Anything outside that chain is either an addition or a deletion.
The most widely used diff algorithm — the one Git uses — is called Myers' diff algorithm, published by Eugene Myers in 1986. It runs in O(ND) time, where N is the total length of both inputs and D is the number of differences. When two versions are similar, D is small and the algorithm runs very fast.
Modern tools add refinements on top of Myers' algorithm, including:
config.json or .env file changed between environments.Most diff tools use a standard set of symbols and colors:
+ (green) — added in the new version. These exist only on the right side.- (red) — removed from the old version. These exist only on the left side.Reading a diff is a skill worth developing. Once you get used to the format, you can scan hundreds of lines in seconds and spot the exact changes that matter.
There are two common layouts for displaying diffs:
Our tool supports both layouts — switch between them based on the task. Side-by-side is easier for prose and legal docs; inline is easier for code where you want to see the change in flow.
Choosing the right granularity changes what the diff highlights:
The text you compare in a diff tool often contains sensitive information — legal contracts, code with API keys, private notes, customer data, or configuration secrets. Uploading it to a remote server for comparison is a real privacy risk. Our Text Diff Tool runs entirely in your browser using native JavaScript. Your text never leaves your device, never touches our servers, and is never logged. You can verify this by opening your browser's Developer Tools → Network tab — no requests are made when you paste or compare text.