Code tool
Diff Checker
Paste two versions of a text or code file to compare them and see which lines were added and which were removed.
Runs entirely in your browser. Nothing you paste is uploaded.
Paste the original and the changed version to compare them.
How to use the Diff Checker
- Paste the original on the left and the changed version on the right.
- Select Compare. Removed lines are marked with a minus sign and added lines with a plus.
- Use the options to ignore whitespace or case, then copy or download the result as a standard .diff file.
How to read the text comparison
A diff checker is a text compare tool: it takes two versions of a text and highlights the difference between them. Use this online diff checker to compare text, code, configuration files or two drafts of a document.
The checker finds the smallest set of line changes that turns the first text into the second, the same approach Git uses. Lines that only exist in the original are shown as removed, lines that only exist in the new version as added, and unchanged lines are folded away so the changes stand out.
Every change is marked with a plus or minus sign as well as colour, and both versions keep their own line numbers so you can find the spot in your editor.
Ignore whitespace changes treats lines as equal when they differ only in indentation or spacing, which is useful after reformatting. The exported unified diff can be applied with git apply or patch.
Common questions
How do I compare two text files online?
Paste the original text in the first box and the changed text in the second. Added lines are marked with a plus sign and removed lines with a minus sign.
Does it work for plain text as well as code?
Yes. It compares any text line by line: code, configuration files, articles or CSV data.
What is a unified diff?
It is the standard patch format used by Git and the patch command, with lines prefixed by + and - and a few lines of context around each change.
Why is a whole block shown as removed and added?
When two versions share very few lines, an exact comparison is not meaningful, so the changed region is shown as one block.
Is my code sent to a server?
No. The comparison runs in your browser and nothing is uploaded.
Guides for the Diff Checker
- How to Read a Git Diff: A Beginner's GuideHow to read a git diff line by line: the file header, hunk markers, plus and minus lines, and the commands that show staged, unstaged and branch changes.
- How to Compare Two Files and See What Changed (Diff Guide)Compare two versions of code or text line by line. How a diff works, how to read plus and minus lines, and how to ignore whitespace and case.
- Markdown Cheat Sheet: Syntax, Tables and Converting to HTMLA Markdown cheat sheet with headings, lists, links, tables, task lists and code blocks, plus how to preview Markdown and convert it to clean HTML.
- How to Minify JavaScript: What Minification Does and WhyMinifying JavaScript removes whitespace and dead code and shortens names, so scripts download and parse faster. How it works and how to do it.