100% Private — All processing happens locally in your browser.

Diff Checker

Compare two texts and see line-by-line differences with color highlighting. Free, private, in-browser.

FreeNo SignupNo UploadsNo Tracking

Diff Checker

Compare two texts and see line-by-line differences with character-level highlighting.

Original
Modified

How to Use Diff Checker

  1. 1

    Paste your texts

    Paste the original text in the left field and the modified text in the right field.

  2. 2

    Click Compare

    Click the Compare button to generate the diff. Added lines appear in green, removed lines in red, and modified lines show both.

  3. 3

    Review differences

    Scroll through the results. Modified lines show character-level highlighting so you can see exactly what changed within each line.

Frequently Asked Questions

The tool uses a Longest Common Subsequence (LCS) algorithm to find line-by-line differences. For modified lines, it also computes character-level diffs to highlight the exact changes within each line.

Yes. The diff checker works with any text including source code, configuration files, prose, and more. It uses a monospaced font and preserves whitespace for accurate code comparison.

The tool runs in your browser, so performance depends on your device. It handles typical code files and text documents well. Very large files (thousands of lines) may take a moment to process.

No. All comparison is done locally in your browser using JavaScript. No data is sent to any server.

Related Tools

How Diff Algorithms Work

The core of every diff tool is the Longest Common Subsequence (LCS) algorithm. Given two sequences of lines, LCS finds the longest sequence of lines that appear in both texts in the same order. Everything not in the LCS is either an addition (present only in the new text) or a deletion (present only in the old text). The classic algorithm runs in O(n*m) time and space, where n and m are the line counts — fast enough for typical files but potentially slow for very large inputs.

Line-Level vs. Character-Level Diffs

Line-level diff tells you which lines changed. Character-level diff (also called word diff or inline diff) shows exactly what changed within a modified line — highlighting the specific characters that were added or removed. This is especially valuable for code review, where a single-character typo in a long line is easy to miss in a line-level diff but immediately visible with character highlighting.

Diff in Professional Workflows

Git uses a variant of the Myers diff algorithm by default, with optional patience and histogram algorithms for better results on certain code patterns. Code review tools like GitHub show unified diffs (additions and deletions interleaved) rather than side-by-side diffs, because unified format uses less vertical space. Understanding diff output is a fundamental developer skill — every pull request, merge conflict, and deployment changeset is expressed as a diff.