Text Diff
Compare two texts and see the differences highlighted
Diff Result
Frequently Asked Questions
What is a text diff?
A diff (short for "difference") compares two pieces of text and shows exactly what changed between them. Lines that were added are highlighted in green, removed lines in red, and unchanged lines in gray.
How does the comparison work?
This tool uses the Longest Common Subsequence (LCS) algorithm to find the minimal set of changes needed to transform the original text into the modified text. It compares line by line for clear, readable output.
Can I compare code files?
Yes. This tool works with any plain text — source code, configuration files, prose, CSV data, JSON, and more. Just paste the contents of your files into the text areas.
Is there a size limit?
There's no hard limit, but very large texts (tens of thousands of lines) may be slow since the comparison runs in your browser. For most practical use cases, it's instant.
Is my data private?
Yes. The entire comparison runs in your browser using JavaScript. No text is ever sent to any server.