Diff Checker
🔒 Processed locally in your browser4.9(222)
Compare two blocks of text or code side-by-side to find differences, added lines, and removed lines. Fast, private line-by-line diff with patch export.
Original (Base Text)7 lines
Modified (New Text)5 lines
Line Comparison Output
+4 additions•-6 deletions•1 unchanged
-1function calculateTotal(items) {
-2 let sum = 0;
-3 for (let i = 0; i < items.length; i++) {
-4 sum += items[i].price;
-5 }
-6 return sum;
+1function calculateTotal(items, discountRate = 0) {
+2 const subtotal = items.reduce((acc, item) => acc + item.price, 0);
+3 const discount = subtotal * discountRate;
+4 return Math.max(0, subtotal - discount);
5}
Found this useful?
About Diff Checker
Compare source code, documents, or revisions side-by-side. Highlights exact line additions, deletions, and unchanged segments using the Longest Common Subsequence algorithm.
How to Use Diff Checker
- 1Paste your original base text into the left pane
- 2Paste your revised or modified text into the right pane
- 3Inspect highlighted additions (+ in green) and deletions (- in red)
- 4Copy the unified patch with line markers
Examples & Calculations
Detecting refactored JavaScript / TypeScript functions
Checking revisions between legal agreements or essay drafts
Frequently Asked Questions
How does the diff algorithm work?▼
It computes line-by-line differences using the Longest Common Subsequence (LCS) dynamic programming algorithm.
Related Tools
Related Guides & Tutorials
4.9(222 verified ratings)
Verified community satisfaction score for Diff Checker.
Rate this tool:
100% Free & Private Browser ToolGoogle Structured Data Verified
Was this tool helpful?