Loading...
Loading...
Free online code diff checker — compare two texts with line-level and word-level diff. Line numbers and color-coded changes for easy review.
Enter text in both panels to see the diff
A diff (short for difference) is a comparison between two texts that highlights what has changed. Diffing is fundamental to version control systems (Git, SVN), code review workflows, patch generation, and understanding changes in configuration files, documents, or any text-based content.
Word-level diff breaks changes down to individual words, useful for prose editing, documentation changes, and small edits. Line-level diff shows entire lines as added, removed, or modified — this is the standard for code changes in version control systems. Both modes have their place depending on what you are comparing.
In version control (Git), diff is the foundation of code review. When you create a pull request, Git computes the diff between branches and presents it for human review. Understanding how to read diffs is essential for effective collaboration: green/red highlighting shows what was added and removed.
Common diff use cases include: reviewing code changes before merging, debugging by comparing working and broken versions, detecting configuration drift between environments, tracking document revisions, and teaching/learning by showing the difference between two code examples.
This tool uses the jsdiff library to compute accurate diffs. It supports both word-level and line-level comparison, handles Unicode text correctly, and presents results in a scrollable view with color-coded additions (green) and deletions (red) for quick visual scanning.
By default, whitespace differences (spaces, tabs, newlines) are treated as changes. Some advanced diff tools offer whitespace-ignoring modes. This tool treats all characters including whitespace as significant — two texts differing only in indentation will show differences.
No. Diff tools work on text content. For binary files, Git uses a heuristic to detect renames and binary changes. Use specialized binary diff tools for images, executables, or compressed files.
Unified diff is the standard format used by Git and most version control systems. It shows changed lines with context lines around them, using + for additions and - for deletions. This tool shows a visual diff rather than the unified format.