Text Diff Checker — Compare Two Texts Online
Compare two blocks of text side by side and see exactly what was added, removed, or changed. Performs a line-by-line diff with color-coded highlighting — all processed locally in your browser.
Frequently Asked Questions
What is a diff?
A diff (short for "difference") is a comparison between two pieces of text that shows which lines were added, removed, or unchanged. Diffs are a fundamental concept in software development, used by version control systems like Git to track changes in code over time.
How does text comparison work?
This tool uses the Longest Common Subsequence (LCS) algorithm to compare texts line by line. It finds the largest set of lines that appear in both texts in the same order, then marks everything else as either added or removed. This approach provides accurate, meaningful diffs even for large texts.
What is a line-by-line diff?
A line-by-line diff compares text at the line level — each line is treated as an atomic unit that is either present or absent. This is how most developer tools (like Git) work by default. Lines that exist only in the original are marked as removed (red), and lines only in the modified version are marked as added (green).
Can I compare code files?
Yes. Simply paste the contents of two code files into the input areas and click Compare. The diff output uses a monospace font and preserves indentation, making it well-suited for comparing code, configuration files, SQL queries, or any structured text.
Related tools: JSON Formatter / Validator · Word Counter