Text Diff & Comparison Tool
Compare two text files or code blocks line-by-line. Highlight additions, deletions, and line modifications 100% locally in your browser.
Recently Used Tools
Visual Line Comparison
Paste text into both boxes above to calculate differences...
How Line-by-Line Text Diffing Works
Comparing text files and finding exact structural differences is a fundamental operation in software engineering, technical writing, legal document review, and data auditing. A text diff utility computes the minimal set of edits (additions and deletions) required to transform an original document into a modified version.
Longest Common Subsequence (LCS) Algorithm
The core of modern diff algorithms (including GNU diff and Git version control) relies on solving the Longest Common Subsequence (LCS) problem. By identifying the longest sequence of lines that appear in both documents in the same relative order, the algorithm isolates exactly which lines were added, removed, or left untouched.
Visualizing Additions and Deletions
Diff outputs follow standardized visual conventions:
- Green (+) Lines: Represent new lines added in the modified text.
- Red (-) Lines: Represent lines present in the original text that were deleted or modified.
- Gray Lines: Unchanged context lines that match between both versions.
Client-Side Confidentiality
Pasting source code, proprietary API responses, or sensitive legal contracts into cloud-hosted diff tools risks exposing confidential intellectual property. FreeFileTool's Text Diff engine executes entirely within your browser's local sandbox, guaranteeing that your text remains confidential.
Frequently Asked Questions
Are my text or code comparison inputs uploaded to any server?
No. FreeFileTool performs line-by-line text comparison 100% inside your browser using pure JavaScript diff algorithms. Your documents, code snippets, and confidential files never leave your device.
How does the text diff algorithm detect changes?
The diff engine computes the Longest Common Subsequence (LCS) between the original and modified text strings, accurately identifying added lines, deleted lines, and modified blocks.
Can I ignore whitespace differences?
Yes! Enabling the 'Ignore Whitespace' toggle trims leading and trailing space differences so you can focus strictly on substantive content changes.
Is this tool suitable for code reviews and configuration files?
Absolutely. It is designed for comparing code snippets, JSON objects, CSV rows, SQL scripts, Markdown documentation, and configuration files.