Format Code Now
/

Text Diff Checker

TX-01

Paste two texts in the one box, with a line containing only ===== between them, and press Compare. Lines starting with - are only in the first text and lines starting with + are only in the second.

Runs in your browser. Nothing is uploaded.

Two texts, separated by a line containing only =====

Unified diff

How to use it

  1. Paste the first text into the input box.
  2. On a new line type ===== on its own, then paste the second text below it.
  3. Press Compare. The unified diff appears with the count of added and removed lines.
  4. Choose how many context lines to show around each change, or All lines to see the whole text.
  5. Turn on Ignore whitespace or Ignore case if those differences do not matter, then copy or download the diff.

How to read the output

The first line counts the lines added and removed. Below it is a unified diff, the same layout used by git diff. A line starting with - exists only in the first text. A line starting with + exists only in the second. A line starting with a space is unchanged context. A header such as @@ -1,4 +1,5 @@ gives the line ranges in each text. The file names are placeholders, called before and after.

What is compared

The comparison is by whole line. If one word changes, the whole line shows as removed and added, and the tool does not mark the changed word. Ignore whitespace treats lines as equal when they differ only in spaces or tabs. Ignore case does the same for upper and lower case. Ignore line endings, on by default, stops Windows and Unix line endings from making every line look changed.

Limits

A difference only in the final line break is not reported. If a line in your own text is exactly =====, the first such line is used as the divider. The output is for reading and sharing, and it cannot be applied with the patch command because the file names are placeholders. For structured data such as JSON, a data-aware comparison is usually clearer than a line diff.

Error messages and what to do

MessageWhat it meansFix
Separator not found. Put a line with only ===== between the two texts.The input has no line made only of five equals signs, so the tool cannot tell where the second text starts.Add ===== on its own line between the two texts.

Questions people ask

How do I compare two texts online?

Paste both texts into the one box with a line containing only ===== between them, then press Compare. You get a unified diff showing which lines were removed and which were added. Nothing is uploaded.

What does a unified diff look like?

It lists changed lines with a prefix: - for a line only in the first text, + for a line only in the second, and a space for unchanged context. Blocks start with a header such as @@ -1,4 +1,5 @@.

Does it show which word changed inside a line?

No. It compares whole lines, so a changed line appears as one removed and one added line. Read the two lines side by side to spot the changed word, or split the text into one word per line first.

How do I ignore whitespace or case in a diff?

Turn on Ignore whitespace to treat lines that differ only in spaces or tabs as equal, and Ignore case to ignore upper and lower case. Both can be on at the same time.

Why does every line show as changed?

Usually the two texts use different line endings, such as Windows CRLF and Unix LF. Ignore line endings is on by default and prevents this. If you turned it off, turn it back on.

Can I use the output with the patch command?

No. The header uses placeholder names, before and after, instead of real file paths, so it is meant for reading and sharing, not for applying. Use git diff in a repository to produce a patch you can apply.

About this tool

Compares whole lines and prints a unified diff: lines starting with - exist only in the first text, lines starting with + only in the second. It does not mark which words or characters changed inside a line. If a line in your own text is exactly =====, the first such line is used as the divider. A difference only in the final line break is not reported, and the output cannot be applied with patch because the file names are placeholders.

Format Code Now: free, no ads, no accounts. Your input stays in your browser.