Developer

Free Diff Checker - Compare Text & Code Online

Compare two blocks of text or code and highlight the differences instantly.

About this tool

A diff checker compares two blocks of text or code and shows you exactly what changed between them. It highlights added lines in green and removed lines in red, making it easy to spot differences at a glance. This is an essential tool for developers reviewing code changes, writers comparing document revisions, and anyone who needs to find differences between two versions of text. This tool uses the Longest Common Subsequence (LCS) algorithm - the same foundation used by git diff - to compute the minimal set of changes between two texts. Results are shown line-by-line in either Unified view (all changes in one column) or Split view (side by side). All comparison happens in your browser instantly, with no data sent to any server.

How to use

Step 1: Paste the original text in the left box and the modified text in the right box.
Step 2: Click Compare to compute and display the differences.
Step 3: Lines highlighted in green are additions (present in the right text only).
Step 4: Lines highlighted in red are deletions (present in the left text only).
Step 5: Switch between Unified and Split view using the toggle. Use Split view for side-by-side comparison.

Frequently Asked Questions

This tool uses the Longest Common Subsequence (LCS) algorithm, the same foundation used by git diff. It finds the minimal set of additions and deletions to transform one text into the other.

Yes. The diff checker works on any plain text, including source code, JSON, XML, configuration files, and prose. Paste your code and click Compare.

Green highlighted lines are additions - lines present in the new/right text but not in the original/left text. Red highlighted lines are deletions - lines present in the original/left text but not in the new/right text. Uncolored lines are unchanged.

There is no hard limit, but very large texts (10,000+ lines) may take a moment to process since the LCS algorithm has O(n*m) time complexity. For extremely large files, command-line tools like diff or git diff are recommended.

Related Tools