Text Diff
Paste two blocks of text and see exactly what changed. Additions, deletions, and unchanged lines highlighted with line numbers.
Text Diff
Paste two blocks of text to see the differences highlighted.
How it works
Text Diff compares two blocks of text line-by-line using the Longest Common Subsequence algorithm — the same approach used by tools like git diff and Unix diff.
The comparison runs automatically as you type with a 300ms debounce, or you can click the Compare button. Results show line numbers for both the original and modified text, with additions in green and deletions in red.
A summary shows the total number of added, removed, and unchanged lines so you can quickly gauge the scope of changes.
FAQ
- How does text diff work?
- The tool uses the Longest Common Subsequence (LCS) algorithm to find the optimal alignment between two texts. It splits both texts into lines, computes the LCS, and then marks lines that appear only in the original as removed and lines that appear only in the modified version as added.
- What is the difference between line-by-line and character diff?
- Line-by-line diff compares entire lines as units — a line is either present, added, or removed. Character-level diff would show changes within individual lines. This tool uses line-by-line comparison, which is the standard approach for code and document review.
- What do the colors mean?
- Green highlights indicate lines that were added in the modified text. Red highlights indicate lines that were removed from the original text. Lines without highlighting are unchanged between the two versions.
- Can I compare code with this tool?
- Yes. The diff output uses a monospace font and preserves whitespace, making it suitable for comparing code, configuration files, JSON, and any other structured text. It works with any programming language.
- Is there a size limit?
- There is no hard limit, but very large texts (over 10,000 lines) may slow down the comparison since the LCS algorithm has O(m x n) complexity. For typical documents and code files, performance is instant.
- Is my text sent anywhere?
- No. The entire comparison runs in your browser using JavaScript. Your text never leaves your device — nothing is uploaded, stored, or transmitted to any server.
Other tools you might like
- Wealth ProjectionBuild wealth or draw it down. Watch compounding tip the scale — and see how long your corpus really lasts.
- Loan & EMI PlannerSee what your loan really costs — month by month, year by year — and how prepayments rewrite the math.
- Mortgage CalculatorMonthly payment, taxes, insurance, PMI — the full picture of what your home really costs.
- Compound Interest CalculatorWatch your money grow year by year. See exactly how compounding works in your favor.
- SIP CalculatorSee how small monthly investments grow into a large corpus through the power of compounding.
- Salary CalculatorYour real take-home pay — federal, state, and FICA, all 50 states.