Text Diff
Paste two blocks of text to instantly see a line-by-line diff with color-coded additions, deletions, and modifications. Useful for comparing code, configs, documents, or any text content.
🔀
Enter text on both sides, then click Compare
How It Works
Paste your texts
Enter or paste the original text on the left and the modified text on the right.
View the diff
Differences are highlighted automatically — red for removed lines, green for added lines, and yellow for changed lines.
Review changes
Scroll through the diff to review every change. Use the statistics summary to see total additions, deletions, and modifications at a glance.
Frequently Asked Questions
How does the diff algorithm work?
The tool uses a longest common subsequence (LCS) algorithm to compute the minimal set of changes between the two texts. Lines are compared one by one, and changes are classified as additions, deletions, or modifications.
Is my text sent to a server?
No. The comparison runs entirely in your browser using client-side JavaScript. No text is transmitted to any server. You can disconnect from the internet and use this tool offline.
Can I compare code with this tool?
Yes. The tool works with any plain text — code, configuration files, prose, CSV data, logs, and more. It compares line by line, making it especially useful for reviewing code changes.
What do the colors mean?
Red highlights lines that were removed from the original text, green highlights lines that were added in the modified text, and yellow highlights lines that exist in both but have been changed.
Related Tools
Find & Replace
NewFind and replace text with support for regex, case sensitivity, and whole word matching.
Remove Duplicate Lines
NewRemove duplicate lines from text, keeping only unique lines.
Sort Lines
NewSort, shuffle, deduplicate, and reorder lines of text alphabetically, numerically, or by length.