0 lines · 0 characters
0 lines · 0 characters
View
Highlight
No changes yet
Paste or open two texts above to see what changed.

About the Text Compare Tool

What is a diff checker?

A diff checker is a tool that compares two versions of a text and shows what changed. It matches the lines both versions share, using the longest common subsequence method behind the Unix diff command and Git, and marks every added, removed or edited line. Inside an edited line, a difference checker highlights the exact words or characters that differ.

What should you know before comparing two texts?

  • Nothing is uploaded. The text compare runs on your device, and the comparison itself sends nothing over the network.
  • Moved lines are marked as moved. A block of text cut from one place and pasted unchanged in another gets a link to its new line number, instead of showing as an unrelated deletion and addition.
  • Hidden characters get a name. A no-break space (U+00A0), a zero-width space (U+200B) or a trailing space shows as a marker inside the change, so a line that looks identical still shows what differs.
  • Long files stay lined up. There's no line limit, and in our tests 50,000 lines with a rewritten 5,000-line block kept all 45,000 unchanged lines matched.
  • The .diff file is a standard unified diff. It applies with patch or git apply, and it still records the changes that the ignore options hide on screen.

How do you compare two texts?

  1. Add the original. Paste it in the left box, drop a file on the box or press Open.
  2. Add the changed version. Put the newer text in the right box the same way.
  3. Read the highlights. Red is removed, green is added, purple is moved, and the up and down arrows step through each change.
  4. Keep the result. Copy or download the diff, or use the arrows between the two sides in the split view to copy a change across.

How do you read a unified diff?

A unified diff marks each line with a symbol at its start. It is the text diff format that Copy diff and Download .diff produce, the same one diff -u and git diff print.

Symbols in a unified diff, as defined by GNU diffutils
Line starts withWhat it means
--- original.txtThe name of the original file
+++ changed.txtThe name of the changed file
@@ -1,7 +1,8 @@A hunk header, here saying that 7 lines starting at line 1 of the original became 8 lines starting at line 1 of the changed text
A spaceA line both texts share, shown for context
-A line only in the original, so it was removed
+A line only in the changed text, so it was added
\ No newline at end of fileThe line above is the last line and has no line break after it

What are the ways to compare two texts?

Text comparison tools differ in what they show and where they run. These are the common ways to compare two texts or files.

Ways to compare two texts or files
MethodHow to run itWhat it showsBest for
Online diff checkerPaste or open two texts in the browserAdded, removed and edited lines, often down to the word or characterQuick checks on any device with nothing to install
Microsoft WordOn the Review tab, choose Compare and pick the original and revised filesA third document with the differences as tracked changes, including formattingWord documents where formatting changes matter
Notepad++ with the ComparePlus pluginInstall ComparePlus from Plugins Admin, open both files, then choose Plugins, ComparePlus, CompareBoth files side by side with added, removed, changed and moved lines markedLocal files on Windows
Visual Studio CodeRun code --diff a.txt b.txt, or select two files and choose Compare SelectedA side-by-side or inline diff inside the editorCode files in a project
git diff or diff -uRun git diff --no-index a.txt b.txt or diff -u a.txt b.txt in a terminalA unified diff in plain textScripts, patches and version control

Common mistakes

These mistakes with a text compare make the result look wrong when the texts are fine.

  • Every line is highlighted. One text indents with tabs and the other with spaces. Turn on Ignore all whitespace, which compares each line with its spaces and tabs removed.
  • A line is flagged but both sides look the same. An invisible character differs, such as a no-break space or a trailing space. Find the marker in the highlight, then retype that spot, or clean the text in the reveal box of the Invisible Text Generator.
  • The whole file is one changed line. Minified code and one-line JSON have no line breaks to compare. Format both sides first, for example with the JSON Formatter, then compare again.

Common Use Cases

People use a text compare whenever two versions of the same text need checking.

  • Contracts and drafts. Find every sentence an editor or the other party changed before you sign or publish.
  • Code snippets. A quick code compare of two functions or two config files shows which line changed between a working version and a broken one.
  • Exports and lists. Compare two CSV exports, or two lists with one item per line, to see what was added or dropped.
  • Copied text. Check that a pasted quote matches its source word for word.

For structured code, the JSON Compare sorts object keys first, and the HTML Compare and CSS Compare format the code before they compare it.

Frequently Asked Questions

Is there a free diff checker?

Yes, this diff checker is free to use. It has no sign-up and no line limit, and it compares text, code and files in any modern browser.

Is text uploaded when you compare two texts online?

Not with this text compare tool, because the comparison runs on your device. Some online diff tools do send your text to their server, so check before you paste anything private.

Can Notepad++ compare two files?

Yes, Notepad++ compares two files with the free ComparePlus plugin. Install it from Plugins Admin, open both files, then choose Plugins, ComparePlus, Compare.

How do you compare two documents in Microsoft Word?

In Microsoft Word, open the Review tab, choose Compare, then pick the original and the revised document. Word creates a third document that shows the differences as tracked changes.

Can a diff checker compare two strings or two lists?

Yes, a diff checker compares strings and lists the same way it compares documents. Put one string or list on each side, with one list item per line so each item is compared on its own.

What does the similarity percentage mean in a text compare?

The similarity percentage is the share of characters, line breaks included, that both texts keep. Unchanged lines, moved lines and the unchanged parts of edited lines all count as kept.

How do you compare two files online?

Drop a file on each box of this text compare, or press Open above each box. Text files such as .txt, .csv, .json, .md and source code open directly, and nothing is uploaded.