TechTools

        

Diff Checker: compare two texts and find the differences

Diff Checker shows exactly what changed between two versions of a text. Paste the original into the first box and the edited version into the second, press Compare, and the result lists the text once with every removed line in red and every added line in blue. When a line was only edited, the changed letters, digits or symbols are marked inside it, so a single typo or a new version number is easy to spot.

It is useful whenever you have two copies of something and need to know how they differ: a configuration file before and after a change, two drafts of a contract or an article, code you copied from a colleague, or two exports of the same data. Developers use it for quick checks when a full version control diff is not at hand; writers and translators use it to see what an editor changed.

The comparison runs in your browser. The texts are not uploaded and not stored, you do not need an account, and the tool is free.

Features

  • Line-by-line comparison that keeps the longest run of lines both texts share and marks the rest as removed or added.
  • Character highlights inside a line that was replaced, so you see the exact characters that differ.
  • Clear colours: removed text red and struck through, added text blue, unchanged lines plain for context.
  • Any plain text: code, JSON, CSV, Markdown, configuration files or ordinary prose.
  • Line endings ignored: a file saved on Windows and the same file saved on Linux or macOS compare as equal.
  • Resizable boxes: drag the corner of an input box to make it taller.

How to compare two texts online

  1. 1

    Paste the original text

    Put the older version into the left box, the one that says Original text. On a phone it is the upper box.

  2. 2

    Paste the modified text

    Put the newer version into the second box, the one that says Modified text.

  3. 3

    Press Compare

    Press Compare in the top bar. On a phone it is the button with the two arrows.

  4. 4

    Read the result

    Read the result box: red struck-through text was removed, blue text was added, and plain lines are the same in both versions.

A short example

Say the original configuration has two lines, timeout = 30 and retries = 3, and the modified one reads timeout = 60, retries = 3 and a new third line verbose = true.

The result starts with the old timeout line, where only the 3 is red and struck through, followed by the new timeout line with only the 6 in blue. The retries line is identical in both versions, so it stays plain. The verbose line exists only in the modified text and is shown in blue as an added line. Reading from top to bottom you get the whole file once, with every change in place.

Behind the scenes the checker finds the longest sequence of lines that both texts have in common. Everything outside that sequence is a difference. A removed line directly followed by an added one is then compared again, character by character, which is what produces the highlights inside a line.

Good to know

  • Moved lines appear twice. A line that moved to another place is shown as removed where it was and added where it is now, because the checker looks for the longest common sequence of lines, not for moves.
  • Invisible changes count. If two lines look identical but are marked, look for a trailing space, a tab or a non-breaking space.
  • Format structured data first. A minified JSON or XML file is one long line. Pretty-print both versions in the Data Formatter with the same indentation, then compare them here line by line.
  • Blocks of edits: when several neighbouring lines changed, the old lines are listed before the new ones, and only the last old line and the first new line get character highlights.

Frequently asked questions

Is this diff checker free?

Yes. It is free and needs no account or sign-up. There is no daily limit; the only practical limit is how much your browser can handle.

Is my text uploaded anywhere?

No. The comparison runs in JavaScript inside your browser tab and the two texts are never sent to a server. The tool saves nothing either, so keep your own copy of any text you still need.

How are the differences shown?

The result box under the inputs lists the whole text once. Unchanged lines are plain, removed lines are red and struck through, and added lines are blue. When a line was replaced by another one, the old version is shown first and the new version below it, with only the changed characters coloured.

Does it compare by line, word or character?

By line first. Lines that match exactly are kept, the rest are marked as removed or added. When a removed line is directly followed by an added line, the two are compared character by character, so a single changed letter or number stands out. There is no separate word mode.

Does it ignore whitespace or letter case?

No. The comparison is exact, so an extra space at the end of a line, a tab instead of spaces or a capital letter counts as a change. The only thing it ignores is the line ending style: Windows (CRLF) and Unix (LF) line breaks are treated the same.

Can I compare two files?

There is no file upload. Open each file in an editor, copy its content and paste it into one of the boxes. Any plain text works this way: source code, configuration files, CSV or JSON data, contracts or article drafts.

How long can the texts be?

There is no fixed limit, but the checker compares every line of one text with every line of the other, so the work grows quickly with size. Texts of a few hundred lines compare instantly, while very large texts with many thousands of lines, or extremely long single lines, can make the tab slow or unresponsive.

Does it work on a phone?

Yes. On a narrow screen the two boxes stack above each other and the result follows below them. Compare is the button with the two arrows in the top bar.

Related tools Data Formatter Markdown Editor Text Editor PasteShare Cron Helper All TechTools