Skip to content
Webmaster Tools
Text & encodingText Diff

Text Diff Checker

Compare two texts.

Diff
Runs in your browser

About the Text Diff Checker

This tool compares two blocks of text line by line and highlights what was added, removed or left unchanged. It finds the longest common subsequence of lines and shows the result either as a unified view with a + or − in front of each changed line, or side by side with the original on the left and the changed text on the right.

Two options help with noisy input. Ignore whitespace collapses runs of spaces and tabs and trims each line before comparing, so reindented lines count as unchanged. Ignore case compares lines case-insensitively. In the unified view, Only changes hides unchanged lines except for two lines of context around each change. It runs in your browser. Inputs larger than 4,000 lines per side are compared up to that limit, with a warning.

How to use it

  1. Paste the original text on the left and the changed text on the right.
  2. Pick Unified or Side by side and set the options.
  3. Read the added, removed and unchanged counts, or click Copy as patch.

Example

Two versions of a config file in the unified view:

  server {
−   listen 80;
+   listen 443 ssl;
    server_name example.com;
  }

Common questions

Why is a whole line marked when I changed one word?

The comparison works on whole lines, so an edited line shows as removed and re-added.

Why do identical-looking lines show as different?

Usually trailing spaces, tabs versus spaces, or Windows CRLF line endings. Turn on Ignore whitespace to rule these out.

Can I use the copied patch with git apply?

Not directly. It lists every line prefixed with +, - or a space, but has no file headers or @@ hunk markers, so it's for reading, not applying.