Text Diff Checker

Paste two versions of text to instantly compare them line by line. Added lines are highlighted green, removed lines red. Works with code, prose, JSON, or any plain text — no sign-up required.

Paste text into both panels above to see the diff.

How the Diff Algorithm Works

This tool uses the Longest Common Subsequence (LCS) algorithm — the same method used by git diff and most version control systems. LCS finds the largest set of lines that appear in both texts in the same order, then marks everything else as added or removed.

+ Added

Lines that exist only in the modified text.

- Removed

Lines that exist only in the original text.

Unchanged

Lines identical in both texts — part of the LCS.

Frequently Asked Questions

How does the text diff checker work?
The tool uses a Longest Common Subsequence (LCS) algorithm — the same technique behind git diff — to find matching lines between your two texts. Lines only in the original are shown in red (removed), lines only in the modified version are shown in green (added), and lines present in both are shown as unchanged.
Can I use this to compare code?
Yes. The diff checker works with any plain text including source code, JSON, HTML, SQL, and Markdown. The comparison is line-by-line, so it works best when both texts share similar line structure.
What is the maximum text size I can compare?
The tool processes up to 500 lines per input. Texts longer than 500 lines are truncated at that limit. For very large files, consider splitting them into sections.
Is my text sent to a server?
No. The entire comparison runs in your browser using JavaScript. Your text is never transmitted to any server or stored anywhere.
What does the color coding mean?
Green lines with a "+" prefix are lines that appear only in the modified text (added). Red lines with a "-" prefix appear only in the original (removed). Lines with no color or prefix are unchanged.
How is this different from a file diff tool?
This tool works with pasted text directly in the browser — no file upload needed. It is designed for quick comparisons of text snippets, code blocks, or document sections rather than large files.