Diff Checker
Compare two texts or code files online for free — paste into both panels and see every addition, deletion, and change highlighted instantly. No sign-up, no account, nothing leaves your browser.
Paste text into both panels to compare them
How It Works
Paste your original
Drop your baseline text into the Original panel — code, prose, config files, or anything else you can paste.
Paste your modified version
Add the updated text to the Modified panel. The diff appears instantly as you type — no button to press.
Pick your view
Toggle between Split (side-by-side) and Unified (interleaved) views depending on how you prefer to read diffs.
Review & export
Green highlights show additions; red shows removals. Copy the diff to clipboard in unified patch format with one click.
How to Use the Diff Checker
- Paste your original (baseline) text into the Original panel on the left.
- Paste your updated text into the Modified panel on the right — the diff updates in real time.
- Use the Split / Unified toggle to switch between side-by-side and interleaved views.
- Check the stats bar to see how many lines were added, removed, or unchanged.
- Click Copy diff to export the result as a unified patch string.
- Click Load sample to try the tool with a ready-made JavaScript example.
Features
- Real-time diff: Results update as you type — no compare button needed.
- Split view: Original and modified text side by side, with matching pairs aligned row by row.
- Unified view: Additions and deletions interleaved in a single column, identical to standard patch output.
- Inline character diff: For lines that changed, individual added and removed characters are highlighted within the line.
- Diff stats: A summary bar counts added lines (green), removed lines (red), and unchanged lines at a glance.
- Line numbers: Both original and modified line numbers are shown in the gutter for easy reference.
- Copy diff: Exports the full diff as a unified patch string (with + and − prefixes) to your clipboard.
- Works with any plain text: Source code, JSON, YAML, Markdown, prose — anything you can paste.
- Your data stays private: The LCS algorithm runs entirely in your browser; nothing is uploaded, stored, or logged.
- No account required: Open the page and start comparing straight away.
- Works offline: Pure client-side JavaScript — once the page has loaded, no network connection is needed.
Understanding the Output
| Colour | Symbol | Meaning |
|---|---|---|
| Green | + | Line or character present in the Modified text but not in Original (addition) |
| Red | − | Line or character present in the Original text but not in Modified (deletion) |
| White | Line present in both texts unchanged (context line) |
Frequently Asked Questions
Is my text uploaded to your servers?
No. All diffing runs locally in your browser using JavaScript. Your text never leaves your device and is never sent to or stored on any server.
What diff algorithm does this use?
The tool uses a Longest Common Subsequence (LCS) algorithm to compute the minimal
line-level diff between the two texts. For pairs of changed lines it also runs a character-level LCS
to highlight exactly which characters were added or removed within the line — the same technique used
by tools like Git's --word-diff flag.
What is the difference between split and unified view?
Split view places the original on the left and the modified on the right, aligning
paired changes row by row so you can compare them at a glance. Unified view interleaves
additions and deletions in a single column — the format used by git diff and standard
patch files.
Can I compare code files?
Yes. The diff checker works with any plain text — source code (JavaScript, Python, TypeScript, CSS, HTML, etc.), configuration files (JSON, YAML, TOML), Markdown, prose, or anything else you can paste into a text field. There is no file size limit other than your browser's available memory.