A diff checker shows you exactly what changed between two versions of some text or code. Paste the original on one side and the new version on the other, and this diff checker marks every added and removed line in color. You can compare line by line, which suits code and configuration files, or word by word, which suits contracts, essays and articles. Options let you ignore capital letters and extra spaces, so that small formatting changes don't hide the changes that really matter. All of the work happens in your browser, so your text stays private.
How to use the diff checker
- Paste the original text into the first box.
- Paste the changed text into the second box.
- Choose lines or words.
- Set the ignore options if you need them.
- Press Compare and read the highlighted result.
What is a diff?
The name comes from diff, a shell command that compares the content of files and reports the differences. The word is used for the output of that command too, and as a verb, so to diff two files is to compare them. Typically, the command is used on text files. Programmers use the same idea every day when reviewing changes to source code, and it's just as helpful for anyone who needs to find out what changed in a document.
How to read the result
- Green lines were added in the new version.
- Red lines were removed from the original.
- Uncolored lines are the same in both.
- The numbers on the left show the line position in each version.
When a line is edited, it appears as one removed line followed by one added line. Word mode is often easier to read in that situation, because only the words that changed will be marked.
Diff checker example
Suppose that the original says “The meeting is on Monday at 3 PM” and the changed version says “The meeting is on Tuesday at 3 PM.” In line mode, the first sentence appears in red and the second in green. In word mode, only “Monday” is marked as removed and “Tuesday” as added, so you can see the exact change at a glance. The summary above the result tells you how many items were added and removed.
Line mode or word mode?
Line mode is the natural choice for code, lists, logs and data, where each line is a separate unit. Word mode works better with paragraphs, where a tiny edit in a long line would otherwise mark the whole line as changed. If you are checking a contract or an edited article, try word mode first, as every changed word will stand out.
The ignore options
Ignore capital letters treats “Name” and “name” as the same, which is useful when only the capitalization has changed. Ignore extra spaces treats any run of spaces or tabs as a single space and overlooks spaces at the ends of lines. It's particularly helpful when code has been reformatted, or when text has been copied from a PDF or a website. Remember that whitespace can matter in some programming languages and data files, so leave this off if you need an exact comparison.
What people use it for
- Developers compare versions of code and configuration files.
- Writers and editors see what changed between drafts.
- Legal and business teams check revised contracts and policies.
- Students and teachers compare versions of assignments.
- System administrators compare log files and settings.
Is my text private?
Yes. The comparison runs on your own device, and the text isn't sent to our server. That makes this tool suitable for source code, contracts and other confidential material. Nothing is saved once you close the page, so copy anything that you want to keep.
How the comparison works
The tool looks for the shortest set of additions and removals that turns the first version into the second. It keeps as many matching lines as possible and marks only what's left over. That is why a moved paragraph shows up as a removal in one place and an addition in another: a basic diff doesn't track moves. Very long inputs take more work, so the tool accepts up to 5,000 lines.
Tips for a cleaner comparison
Before you compare, make sure that both versions use the same format. If one version came from a word processor and the other from a website, there may be differences in quotation marks and dashes that look identical on screen but count as changes. Try comparing a small section first if the result looks too busy. When you're reviewing someone else's edits, read the removed text as carefully as the added text, because a deleted sentence is just as important as a new one.
Common mistakes
- Pasting the versions in the wrong boxes. The colors will be reversed.
- Using line mode on long paragraphs. Word mode is clearer.
- Ignoring spaces when they matter. Some file formats depend on them.
- Comparing formatted text directly. Bold and links aren't compared, only the words.
Related developer tools
Clean up data with the JSON formatter, test patterns with the regex tester, and verify files with the SHA-256 hash generator.
What next
Use this often? Add Diff to your Home screen.
Frequently asked questions
How does the diff checker work?
It finds the fewest additions and removals needed to turn the original into the changed version, then highlights them.
Can it compare code?
Yes. Line mode is designed for code and configuration files.
Can it ignore whitespace?
Yes. Turn on Ignore extra spaces.
Is my text uploaded?
No. The comparison runs in your browser.
What does the green highlight mean?
Green marks text that was added. Red marks text that was removed.
Sources
Was this tool helpful?
What went wrong?
We only receive the reason you pick, never what you typed into the tool.
Thanks for your feedback.