Code Diff Checker — Find Differences Between Two Texts Online
Paste two versions of any code or text and see exactly what changed: lines that were added are highlighted green, lines that were removed are highlighted red, and the exact words that changed inside a modified line are marked for you. The comparison runs entirely in your browser — your code is never uploaded to a server.
🔒 Private by design: the comparison runs with local JavaScript in your browser. Nothing you paste is sent anywhere, so it is safe for proprietary code and unpublished drafts.
How to compare two texts or code files
- Paste the original into the left box, or load it from a file with the file picker under the box.
- Paste the changed version into the right box the same way.
- Choose your options — ignore whitespace if indentation changes should not count, ignore case if only capitalization changed.
- Press Compare. Removed lines appear in red with a minus sign, added lines in green with a plus sign, and inside a line that exists on both sides, the exact words that changed are highlighted.
- Download the result as a standard .diff file if you want to save it or share it with a teammate.
How the comparison works
The checker compares your texts line by line using a longest-common-subsequence (LCS) algorithm — the same family of algorithms behind git diff. It finds the longest set of lines that stayed the same, which tells it exactly which lines were removed and which were added in between. When a removed line and an added line sit in the same spot, the tool runs the same comparison again at word level, so you can see precisely which words were edited instead of just knowing the whole line changed.
Features
- Line-by-line highlighting — additions in green, deletions in red, with old and new line numbers on every row.
- Word-level highlighting — inside a modified line, only the words that actually changed are marked.
- Ignore whitespace and ignore case — optional, for when formatting or capitalization changes are just noise.
- File loading — load any text-based file (source code, logs, JSON, CSV, config files) straight from your device.
- Similarity score — a quick percentage of how much of the text stayed the same, plus counts of added, removed and unchanged lines.
- Downloadable .diff — save the comparison in the standard unified format used by Git and code review tools.
- Completely private — everything runs in your browser; nothing is uploaded, stored or logged.
- Free, no sign-up.
What is a diff used for?
Programmers diff code before committing it, to review exactly what a change does. Writers diff two drafts of a contract or article to catch every edit. Support and operations teams diff configuration files or log outputs to find the one line that changed before something broke. Any time you have two versions of the same text and need to know what is different, a diff gives you the answer in seconds instead of a line-by-line read-through.
Related developer tools
Also in this section: the JWT decoder for inspecting tokens, the log PII masker for cleaning logs before sharing, the HAR file sanitizer for network captures, and the cURL to Fetch/Axios converter for turning terminal commands into JavaScript.
Frequently asked questions
Is my code uploaded to a server?
No. The comparison runs entirely in your browser with local JavaScript — nothing you paste is transmitted, stored or logged. That makes this checker safe for proprietary code, configuration files with secrets removed, and unpublished drafts.
Which programming languages does it support?
All of them. The checker is language-agnostic: it compares plain text line by line, so it works the same for JavaScript, Python, Java, HTML, JSON, SQL, log files or ordinary prose.
Why does a whole line show as removed and added when I only changed one word?
That is how line-based diff works: if any character on a line changes, the line counts as changed. This tool softens that by also highlighting the exact words that changed inside such lines, so you can spot the real edit at a glance.
How large a text can I compare?
It comfortably handles a few thousand lines on each side, which covers most files and snippets. Very large files (tens of thousands of lines) are better compared with a desktop Git client.
What do the ignore whitespace and ignore case options do?
Ignore whitespace treats lines that differ only in leading or trailing spaces as identical — useful after a reformat. Ignore case treats lines that differ only in capitalization as identical. The original text is always what gets displayed; the options only affect how lines are matched.
Can I save the comparison?
Yes. After comparing, the Download .diff button saves the result in the standard diff format, which you can open in any text editor or attach to a code review.