Free Diff Tool

Compare two text inputs and see the differences highlighted line by line. Runs in your browser — your data never leaves your machine.

Original
Modified

📝 Line-level Diff

Compares text line by line using a longest common subsequence algorithm. See exactly which lines were added, removed, or unchanged.

🎨 Color Highlighting

Added lines are highlighted in green and removed lines in red, making differences instantly visible at a glance.

🔢 Line Numbers

Line numbers are displayed alongside the diff output so you can quickly locate changes in large texts or code files.

How to Compare Text Online

Paste your original text in the left panel and the modified text in the right panel. The diff output instantly highlights the differences — green for lines that were added and red for lines that were removed. Line numbers help you pinpoint the exact location of each change.

Understanding Diff Output

A diff (short for difference) compares two texts and shows what changed between them. Lines prefixed with a plus sign (+) are additions — they exist in the new text but not the original. Lines prefixed with a minus sign (-) are removals — they existed in the original but not the new text. Unchanged lines provide context around the changes.

Frequently Asked Questions

How does the diff tool work?
The tool uses a longest common subsequence (LCS) algorithm to compare two text inputs line by line. Differences are highlighted with colors — green for added lines and red for removed lines.
Does it show additions and removals?
Yes — added lines are highlighted in green and removed lines in red, making it easy to see exactly what changed between the two texts.
Can I compare files?
Yes — paste the contents of any two files into the left and right panels to compare them. The tool works with any plain text content.
Is this tool free?
Yes — completely free, forever. No sign-up, no account, no usage limits.
Is my data safe?
All comparison happens locally in your browser using JavaScript. Nothing is uploaded to any server. It's safe to use with sensitive or proprietary data.
Does it work with code?
Yes — the diff tool works with any text, including source code in any programming language. Line numbers help you locate changes quickly.