Text Diff & Compare
Paste your original and modified text below to see differences highlighted instantly. Supports line-by-line and word-by-word comparison.
Frequently Asked Questions
How does the text diff tool work?
The tool uses a Longest Common Subsequence (LCS) algorithm to compare the two texts. It identifies lines or words that are added, removed, or unchanged, then highlights them with colour coding: green for additions, red for deletions, and no highlight for unchanged content.
What is the difference between line-by-line and word-by-word diff?
Line-by-line diff compares entire lines and marks each line as added, removed, or unchanged. Word-by-word diff breaks the text into individual words and highlights exactly which words changed, making it easier to spot small edits within a line.
What does “ignore whitespace” do?
When enabled, the tool normalises all whitespace (spaces, tabs, multiple spaces) to a single space before comparing. This means differences caused only by formatting or indentation changes are ignored.
Is there a size limit for the texts?
No server-imposed limit. The tool runs entirely in your browser. Very large texts (over 100,000 lines) may cause some lag due to the comparison algorithm running client-side.
Can I use this to compare code?
Yes. The tool works with any plain text, including source code, configuration files, JSON, CSV, and more. Use the line-by-line mode for code diffs and enable ignore-whitespace to focus on meaningful changes.