How to use the Text Comparison / Diff
Compare two texts in three steps:
1
Paste original and modified text
Paste the original text into the left panel and the modified version into the right panel. Both panels support paste and file upload.
2
Choose diff mode and options
Select Line diff (highlights entire changed lines) or Word diff (highlights the exact words that changed within each line). Toggle 'Ignore whitespace' to treat spacing differences as equal.
3
Review the diff table
A three-column table shows line numbers, the original, and the modified side by side. Added lines are green, removed lines are red. Stats pills show counts of added, removed, and unchanged lines.
When to use this tool
Use to find and visualise exactly what changed between two text versions:
- →Comparing two versions of a document to see exactly what lines were added, removed, or changed
- →Reviewing edits made by a collaborator or editor against the original text before accepting changes
- →Checking whether two blocks of pasted content are identical or contain subtle differences
- →Comparing two translations or paraphrased versions of the same source text for divergence
- →Verifying that a code or configuration snippet was copied without accidental modification
- →Identifying what changed between two AI-generated drafts of the same prompt to evaluate improvement
Frequently asked questions
Q:What is the difference between Line diff and Word diff mode?
Line diff compares entire lines — if even one word changes in a line, the entire line is marked as removed (red) and the new version is marked as added (green). Word diff goes further: it detects pairs of adjacent removed and added lines (which represent a changed line) and computes a secondary word-level diff within them, highlighting the specific words or tokens that changed with darker marks inside the green or red background. Word diff is more informative for prose editing where single words change.
Q:How does the diff algorithm work?
The tool uses a custom implementation of the Longest Common Subsequence (LCS) algorithm, the same foundation used by Unix diff, Git, and most version control systems. LCS finds the longest sequence of lines (or words in word mode) that appear in both versions unchanged, then marks everything not in the LCS as either deleted (in the original only) or inserted (in the modified only). No external diff library is used — all logic runs in your browser.
Q:What does 'Ignore whitespace' do?
When enabled, each line is trimmed and internal whitespace runs are collapsed to a single space before comparison. Two lines that differ only in leading/trailing spaces or internal spacing (e.g. different indentation or double spaces) are treated as equal and shown as unchanged. This is useful for comparing code that has been reformatted, or prose that has been reflowed at different margins.
Q:Can I compare files rather than pasted text?
Yes — each input panel has an upload button that accepts .txt, .md, and .csv files. Click the upload icon in the panel header and select a file. The file's text content is loaded into that panel. Both panels can load files simultaneously, so you can compare two .txt or .md file versions directly without copying and pasting.
Q:Is there a size limit on the texts I can compare?
The LCS algorithm runs in O(m × n) time and memory where m and n are the line counts. For typical documents of a few hundred lines the diff is near-instant. For very large files with thousands of lines the computation may take a few seconds and use significant browser memory. Texts of up to a few thousand lines each are handled comfortably in a modern browser.
Q:What does the 'Identical' badge mean?
When both text panels contain exactly the same content (character-for-character), a green 'Identical' badge appears in the diff table header and a stats pill confirms the texts are identical. This is useful when you suspect two versions are the same and want a quick definitive confirmation without reading through the text manually.