Skip to main content

    Text Diff Checker

    Compare two texts side by side and see exactly what changed. Highlights additions, deletions, and unchanged lines.

    Free to use. Runs in your browser.

    Paste two versions of text to see additions (green) and deletions (red) highlighted line by line.

    What Is a Text Diff and Why Developers Use It Daily

    A diff (short for "difference") shows you exactly what changed between two pieces of text. Added lines, deleted lines, and modified lines, all highlighted clearly so you don't have to squint at two versions side by side. It's the foundation of every code review, every version control system, and every "track changes" feature.

    Git uses diffs internally to track every change you've ever made. When you run "git diff", you see the same kind of output this tool generates. Code review tools like GitHub and GitLab display diffs to help teams review changes before they're merged.

    This tool isn't just for code. Compare two versions of a contract, spot differences in API responses, verify config file changes, or check if two "identical" texts are actually identical. Paste the original on the left, the modified version on the right, and see every difference instantly.

    Diff Algorithms Compared

    AlgorithmHow It WorksBest For
    Line-by-lineCompares entire lines as unitsCode files, config files, structured text
    Word-by-wordCompares individual words within linesProse, documentation, content changes
    Character-by-characterCompares every single characterFinding typos, subtle whitespace differences
    Myers (Git default)Finds shortest edit distance between textsGeneral purpose, produces minimal diffs
    PatienceMatches unique lines first, then fills gapsCode with many similar lines (HTML, CSV)

    What this means for you: This tool uses a character-level diff for maximum detail. For code reviews, line-level diffs (like Git) are usually more readable. For finding subtle text differences, character-level is what you want.

    Practical Uses for Text Diffs

    Comparing API responses

    Getting different results from an API call? Paste both responses and see exactly which fields changed. Great for debugging staging vs production differences.

    Verifying config changes

    Before deploying a config change, diff the old and new versions. This catches accidental modifications, a misplaced comma in JSON or a typo in a database connection string.

    Document version comparison

    Compare two versions of a legal document, specification, or email draft. The diff highlights every word that was added, removed, or changed, much faster than reading both versions manually.

    Finding hidden characters

    Two strings look identical but aren't equal? A diff can reveal invisible differences: trailing spaces, tab-vs-space issues, different line endings (CRLF vs LF), or zero-width characters.

    Understanding Diff Output

    IndicatorMeaningWhat To Look For
    + Added (green)Text exists in the new version but not the oldNew features, additions, expansions
    - Removed (red)Text existed in the old version but was deletedDeleted code, removed features
    ~ ModifiedLine exists in both but content changedEdits, fixes, value changes
    UnchangedIdentical in both versionsContext, helps you orient yourself

    Related Tools

    How to use this tool

    1

    Paste the original text in the left box

    2

    Paste the modified text in the right box

    3

    Click Compare to see additions, deletions, and unchanged lines

    Common uses

    • Comparing API response versions during debugging
    • Reviewing config file changes before deployment
    • Checking document revisions for content differences
    • Finding hidden character differences in strings

    Share this tool

    Frequently Asked Questions

    How does the diff checker work?
    It compares your two texts line by line using an LCS (Longest Common Subsequence) algorithm, the same approach used by Git. Added lines show in green, deleted lines in red, and unchanged lines appear uncoloured.
    Is my text sent to a server?
    No. All comparison runs locally in your browser using JavaScript. Your texts never leave your device. There are no server calls, no storage, and no tracking.
    Can it compare code?
    Yes. It works with any text: code (JavaScript, Python, SQL), config files (JSON, YAML, .env), prose, CSV data, and HTML. The line-by-line comparison is especially useful for code reviews.
    Does it handle large files?
    It handles texts up to roughly 100,000 characters efficiently. Very large files (500K+ characters) may cause a brief pause. For massive files, consider using command-line diff or a dedicated diff tool like Beyond Compare.
    Can I find invisible character differences?
    Yes. If two strings look identical but aren't equal, the diff reveals invisible differences: trailing spaces, tab-vs-space issues, different line endings (CRLF vs LF on Windows/Mac), or zero-width Unicode characters.
    What's the difference between this and Git diff?
    Git diff compares files in a repository with context about commits and branches. This tool compares any two texts directly, no Git needed. Both use similar underlying algorithms (LCS-based), but this tool is simpler and runs in your browser.
    Can I compare JSON responses?
    Yes, and it's one of the most common use cases. Format both JSON strings first (use our JSON Formatter) so each key is on its own line, then paste them here. The diff will show exactly which fields changed.
    How do I read the diff output?
    Lines starting with + (green) were added in the modified text. Lines starting with − (red) were removed from the original. Lines with no marker are unchanged. The summary shows total added, removed, and unchanged lines.
    Does it do word-level or character-level diff?
    This tool does line-level comparison, it identifies which lines changed. For word-level or character-level differences within a line, you'd need a more specialised tool. Line-level is the standard for code comparison.
    Can I compare database query results?
    Yes. Export your results as CSV or text, paste both versions, and compare. This is great for verifying that a query change produces the expected output differences.
    What about whitespace differences?
    The tool treats whitespace as significant by default, a line with a trailing space is different from one without. This is usually what you want for code. For prose comparison where whitespace doesn't matter, trim your text first.
    Can I save or share the diff result?
    Currently the diff is displayed in your browser only. You can screenshot it or copy the output. For shareable diffs, consider creating a GitHub Gist or using a service like pastebin.

    Results are for general informational purposes only and should be checked before use. They are not professional advice. See our Disclaimer and Terms of Service.