← Imperial Products / Tools / Diff Checker

Diff Checker — Compare Text Online

Paste two pieces of text and instantly see what changed. Added lines, removed lines, and inline differences — all highlighted. Runs entirely in your browser.

Original
Modified
Added Removed Unchanged
Paste text in both panels above and click Compare
No comparison yet.

What is a Diff Checker?

A diff checker compares two versions of a text and highlights exactly what changed between them. The term "diff" comes from the Unix diff command, which outputs the differences between two files line-by-line. Developers use diff tools every day to review code changes, compare configuration files, spot accidental edits, and understand what changed between versions.

How to Use This Tool

Features

Common Use Cases

More Free Developer Tools

How Diff Algorithms Work

Most diff tools — including this one and the Unix diff command — are built on the Longest Common Subsequence (LCS) algorithm. LCS finds the largest set of lines that appear in the same order in both versions, then marks everything outside that set as added or removed. The result is the minimum edit to transform version A into version B. For large files, the Myers diff algorithm (used by Git) offers better performance by framing the problem as finding the shortest edit script on a graph rather than filling an LCS table. Within changed lines, a second character-level LCS pass identifies the exact characters that were inserted or deleted, enabling the inline highlighting you see here.

Practical Use Cases

In code review, diff tools are essential for understanding what a pull request changes without reading every unchanged line. In document comparison — contracts, policies, configuration files — a diff makes it immediately obvious what was added or removed between two drafts, preventing the need to read both documents in full. Diff checkers are also used to validate that a text transformation (reformatting, translation, auto-generation) produced the expected output, or to spot unintended changes introduced by an automated process.

Tips for Effective Diffing

Use Ignore whitespace when comparing code that has been reformatted or indented differently — otherwise every reindented line appears as a change. Use Ignore case when diffing prose or case-insensitive config values. For very large files, consider diffing only the relevant section rather than the entire document to keep the output scannable. When diffing minified code, run a formatter on both versions first so the diff reflects logical changes rather than whitespace differences.