Paste two versions of any text or code and instantly see what changed. Line-by-line diff with green additions, red deletions, and unchanged lines.
paste text in both panels
Original text / Version A
Changed text / Version B
Diff output
β added
β removed
β unchanged
How to Use the Diff Checker
Paste original text β the 'before' version of your content in the left panel.
Paste modified text β the 'after' version in the right panel.
Click Compare β differences are highlighted: red for deleted lines, green for added lines, yellow for changed lines.
Review changes β scroll through the diff to see exactly what changed between the two versions.
Use for code, documents, or any text β works with source code, configuration files, prose documents, CSV data, or any text-based content.
π Most common use cases: Comparing two versions of a document before and after editing. Checking what changed between two API responses. Reviewing configuration file changes. Comparing code snippets when debugging. Verifying that a copy-paste preserved all content correctly.
Understanding Text Diffing
π How Diff Works
The diff algorithm (typically Myers diff or Patience diff) finds the Longest Common Subsequence (LCS) between two texts. Lines in the LCS are unchanged. Everything else is classified as added (in new only) or deleted (in original only). This produces the minimal set of changes needed to transform original into modified text.
π Diff Output Formats
Unified diff: the standard format used by git β shows context lines around changes with + and - prefixes. Side-by-side: original and modified shown in parallel columns. Inline: changes shown within a single text flow with markup. This tool uses visual highlighting for human readability.
π Line vs Character Diff
Line-level diff shows which lines changed β fast and readable for most purposes. Character-level (or word-level) diff shows exactly which characters within a changed line are different β useful for spotting subtle changes like a single wrong letter in a long line. Both views are valuable depending on the nature of the changes.
π Git and Version Control
Git uses diff algorithms internally for every commit. `git diff` shows unstaged changes. `git diff --staged` shows staged changes. `git diff commit1 commit2` compares any two commits. Understanding diff output is essential for effective Git use β it is the primary way to review changes before committing.
When two people edit the same file, a three-way merge compares: original version, person A's version, person B's version. Changes that don't conflict are merged automatically. Conflicting changes (both modified the same lines differently) require manual resolution. This is how Git merge, GitHub pull requests, and collaborative editing work.
β‘ Diff in CI/CD
Automated diff checking in CI/CD pipelines: snapshot testing compares rendered UI screenshots or output strings against stored snapshots, failing if anything changed unexpectedly. Infrastructure-as-code tools (Terraform plan) diff current vs desired infrastructure state before applying changes. Diff-based change detection makes automated testing more robust.
Diff Tools in Development Workflow
Code review best practices
Effective code review relies entirely on reading diffs. Focus on: logic changes (not formatting), security implications of changed code, test coverage for new/changed logic, and whether the change is minimal (no unrelated modifications mixed in). The best pull requests have small, focused diffs that are easy to review. Large diffs (thousands of lines) are reviewed poorly β split large changes into sequential smaller pull requests.
Configuration management
Infrastructure and application configuration changes are high-risk β small errors can cause outages. Diff checking before applying configuration changes is essential: compare new config against current running config before deployment, use configuration management tools (Ansible, Chef, Puppet) that show diffs before applying, and maintain configuration in version control so every change has an associated diff and author.
Content editing workflow
Writers and editors use diff tools to track document changes across revisions, collaborate on edits without losing original content, and review what changed between draft versions. For legal and compliance documents where exact wording matters, diff checking is essential before finalising any revised version. The diff captures the editorial history in a way that 'Track Changes' in word processors aims to replicate.
π§ Diff in the terminal: `diff file1.txt file2.txt` β basic line diff. `diff -u file1.txt file2.txt` β unified format (git-style). `diff -y file1.txt file2.txt` β side by side. `diff -r dir1/ dir2/` β recursive directory diff. `git diff HEAD~1` β compare current to previous commit. These commands work on any text file without needing a web tool.
Frequently Asked Questions
What is a diff checker?
A diff checker compares two pieces of text (or code) and highlights what has been added, removed, or left unchanged. The name 'diff' comes from the Unix diff command, which is the foundation of version control systems like Git.
What does the + and β symbol mean?
Lines starting with + (green) appear in Version B but not Version A β they were added. Lines starting with β (red) appear in Version A but not Version B β they were removed. Lines with no symbol are identical in both versions.
Can I compare code?
Yes. Paste any code β JavaScript, Python, HTML, CSS, SQL, JSON β and the diff will highlight exactly which lines changed. This is particularly useful for reviewing changes before committing to version control.
How does the comparison algorithm work?
This tool uses the Longest Common Subsequence (LCS) algorithm β the same approach used by Git's diff engine. It finds the maximum number of lines that appear in the same order in both texts, then marks everything else as added or removed.