Code Diff Tool
Compare two code snippets side by side with syntax-aware diffing and color-coded change highlighting
| 1 | 1 |
How to Use This Tool
Paste the original code in the left editor and the modified code in the right editor.
The diff is computed automatically — added lines in green, removed lines in red.
Switch between Unified view and Side-by-Side view.
Use the Swap button to switch original and modified. Copy the diff output.
About This Tool
Code Diff Tool compares two pieces of code and highlights differences using a Longest Common Subsequence algorithm. Choose Unified view for compact diffs or Side-by-Side for visual comparison. Stats show lines added, removed, and unchanged.
Frequently Asked Questions
It uses a Longest Common Subsequence (LCS) algorithm, the same foundational approach used by git diff.
Unified shows changes in a single column. Side-by-Side shows original on the left, modified on the right.
Share This Tool
Related Tools
JSON Formatter
Format, validate, and beautify JSON data with syntax highlighting, error detection, and tree view
HTML Encoder/Decoder
Encode and decode HTML entities, special characters, and Unicode symbols for safe web content
URL Encoder/Decoder
Encode and decode URLs and query parameters for safe transmission in web applications and APIs
Base64 Encoder/Decoder
Encode and decode text or binary data in Base64 format for embedding images, APIs, and data transfer
JWT Decoder
Decode and inspect JSON Web Token headers, payloads, and signatures with expiration time validation
Regex Tester
Test, debug, and validate regular expressions with real-time matching, group highlighting, and flag support