Diff Checker
Compare code or text with line-by-line diff and unified output.
How to Use the Diff Checker
Paste your original code in the left box and the modified version in the right box, then click Compare. The diff output shows each line color-coded with line numbers:
- Green (+) — lines that were added in the modified code.
- Red (-) — lines that were removed from the original code.
- Gray — lines that are unchanged between both versions.
Line Numbers
Each line shows two numbers: the original file line number (left) and the modified file line number (right). Removed lines only show the original number, and added lines only show the modified number.
Unified Diff Output
Click Copy as Unified Diff to copy the diff in standard unified diff format, which you can paste into code reviews, pull requests, or share with teammates.
Extra Controls
- Swap — switches the original and modified inputs so you can view the diff in reverse.
- Clear — empties both text areas and resets the output.
Everything runs in your browser — no code is uploaded or stored anywhere.
Frequently Asked Questions
How does the diff algorithm work?
The tool uses a longest common subsequence (LCS) algorithm to compare lines. It finds the longest sequence of lines common to both inputs, then marks remaining lines as added or removed.
Is my code stored or uploaded anywhere?
No. All processing happens locally in your browser. Your code never leaves your device.
What is unified diff format?
Unified diff is a standard format used by tools like git diff and patch. Lines starting with + are additions, - are removals, and lines with a space prefix are unchanged context lines.
Can I compare any type of text?
Yes. While this tool is optimized for code with line numbers and monospace font, it works equally well for configuration files, prose, logs, or any text content.
Is there a size limit?
There is no hard limit, but very large files (tens of thousands of lines) may slow down the comparison since it runs in your browser. Typical code files work instantly.
More Developer Tools
JSON Formatter
Format, validate and minify JSON with syntax highlighting.
Open tool →Base64 Encode / Decode
Encode text to Base64 or decode Base64 back to text.
Open tool →UUID Generator
Generate UUID v4 identifiers, single or in bulk.
Open tool →Unix Timestamp Converter
Convert Unix timestamps to human-readable dates and back.
Open tool →URL Encode / Decode
Encode or decode URLs and query parameters.
Open tool →HTML Entity Encode / Decode
Encode special characters to HTML entities or decode them back.
Open tool →