Diff Checker

You have two versions of the same thing and you need to know what changed. Paste one into each box below and the differences show up straight away, down to the individual word.

And if you have been staring at two lines that look completely identical while your computer insists they are different, do not worry, you are not going mad. That is a real thing, it happens constantly, and it is the main reason this page exists. There is a whole section on it below.

Neither side leaves your browser. The comparison runs on your own computer, so there is no upload and no server. That is worth saying plainly, because people put contracts, config files and environment files into these tools, and an environment file is mostly passwords.

Paste something into both boxes and the comparison appears here. Or press Example to see the differences that hide from you.

Compared in your browser. Neither side is uploaded, and nothing is stored.

When two identical looking lines are not identical

This is the situation that costs people an afternoon. Two lines on screen. They look exactly the same. You have read them character by character three times. Your computer still says they are different.

Think of it like two envelopes with the same address written on them, except one was written with a pen that has run out halfway and left an invisible dent in the paper. To your eye, the same. To a machine reading the dents, not the same at all.

Almost every diff tool will highlight the line and leave you there. This one tells you which of these it is:

  • A trailing space. One line ends with a space or two and the other does not. Completely invisible. This is the most common one by a distance.
  • A tab where the other has spaces. They line up identically on screen and they are different characters. Every argument about indentation ever had starts here.
  • A non-breaking space. Copy anything out of a web page and you can pick one of these up. It looks exactly like a space and it is not one.
  • A curly quote. Word, Google Docs and Notes quietly turn your straight apostrophe into a slanted one. In prose nobody notices. In code or a config file it breaks things.
  • A zero width character. Takes up no room whatsoever on screen. These come out of web pages and PDFs and they are genuinely invisible, not just easy to miss.
  • An accent written two ways. The letter é can be one character, or it can be a plain e followed by a separate accent mark. They render identically. No computer anywhere treats them as equal.
  • Different line endings. Windows ends a line with two characters and Mac and Linux use one. Nothing shows on screen, and to git and to most comparison tools every single line in the file is different.

Press Example on the tool to see several of these at once. Every pair in it looks the same and none of them are.

Where it stops. It knows the handful of causes above because those are the ones that actually happen. If two lines differ by some other unusual character it will still show you that they differ, and it will still highlight the exact spot, but it will not have a name for it. Switch on Show spaces and tabs in that case and you will see the character marked out.

Line endings, and why every line suddenly looks changed

If a comparison says every single line is different when you only changed one, this is nearly always why.

Windows marks the end of a line with two invisible characters. Mac and Linux use one. Open a file on a Windows machine, save it, and every line in it has quietly changed even though the text is untouched.

This tool ignores that difference when it compares, so you see the change you actually made, and it tells you above the results that the two files use different endings so you know it is there.

Where it stops. Ignoring it here does not fix it in your file. If git is showing you an entire file as changed, the fix is on your side, usually a .gitattributes file or your editor’s line ending setting. This page will only tell you that is what you are looking at.

What the colours mean

  • Pink on the left, green on the right. That line exists on both sides and changed. Inside it, only the words that actually differ are shaded, so you can go straight to them instead of reading the whole line.
  • Pink on the left only. That line was removed.
  • Green on the right only. That line was added.
  • An orange line number. That pair is one of the invisible cases. The panel above the comparison says which.

The options, and what each one costs you

Every one of these hides something. That is the point of them, and it is also the risk, so the tool tells you how many lines it is treating as matching that are not really identical.

  • Ignore spacing. Treats any run of whitespace as the same as any other. Useful when someone has reindented a file and you want the real changes. It will hide a genuine spacing bug, so turn it off before you finish.
  • Ignore capitals. Useful for prose. Dangerous for anything a computer reads, because plenty of things are case sensitive.
  • Ignore blank lines. Useful when one version has been reformatted with extra spacing between blocks.
  • Show spaces and tabs. Draws every space as a dot and every tab as an arrow. Ugly, and the fastest way to see what is going on when nothing else explains it.
  • Only changed lines. Hides everything that matched. Good for a long file where three lines moved.

Frequently asked questions

Is my text sent anywhere?

No. The comparison runs in your browser and there is no upload of any kind. You can check that yourself rather than taking my word for it: open your browser’s developer tools, go to the Network tab, and paste something in. Nothing is sent. You can also disconnect from the internet and it carries on working.

How big a file can it handle?

Up to 6,000 lines a side, and it will also stop after a few seconds if the two versions turn out to share almost nothing.

The reason for the second limit is worth knowing, because it explains why some comparisons are instant and others are not. The work depends on how different the two sides are, not on how long they are. Five thousand nearly identical lines take a couple of milliseconds. Three thousand lines with nothing whatsoever in common take several seconds, because the tool has to try far more combinations before it can be sure it found the smallest set of changes.

Where it stops. When it hits that ceiling it says so and stops rather than locking up the tab. Freezing your browser and pretending to still be working would be worse than admitting it. For anything bigger, git diff or the diff command on your own machine will do it faster than any web page can.

Can it compare two files rather than pasted text?

Not directly. Open each one and paste it in. That is a deliberate choice: a file picker on a page that promises nothing is uploaded invites the exact suspicion the promise is there to remove, and pasting takes about the same amount of time.

Why does it show a change differently from git?

When several lines change together there is usually more than one correct way to describe it, and different tools pick differently. One might call it two lines changed, another one line removed and one added. Both describe the same edit and neither is wrong.

The one real difference is line endings, covered above. This tool ignores them on purpose and git does not.

What is the difference between a diff checker and a text compare tool?

Nothing at all. They are two names for the same job, and this page does it. Diff is just the word programmers use, short for difference.

If you have any issues, you can ask me via comment, and I will love to help you out.