bytekit

Text Diff Checker

Paste two versions of a text or file and see exactly what changed, side by side, with added, removed and edited words highlighted. Everything runs in your browser, so nothing is uploaded.

  • Free
  • No sign-up
  • Runs in your browser

0 lines · 0 characters

0 lines · 0 characters

Paste two texts above to compare them.

Both texts are compared on your device with the Myers diff algorithm. Nothing is uploaded.

What it is for

A diff shows the differences between two texts. This checker lines up the original and the changed version, marks lines that were added, removed or edited, and highlights the exact words that changed inside each edited line.

  • Check what a colleague changed in a document, contract or essay.
  • Compare two config files, API responses or log outputs to find the difference.
  • Review a code change when you do not have git at hand.
  • Make sure a copy-pasted text matches the original word for word.

How to use it

  1. Paste the original text on the left and the changed text on the right, or open a file on each side.
  2. Read the summary, which counts the added, removed and changed lines.
  3. Switch between Side by side and Inline views, and choose whether to ignore whitespace or case.
  4. Copy the result as a unified diff if you want to share it or save it.

Examples

One word changed and one line added

You enter

Original: The quick brown fox jumps over the lazy dog. Changed: The quick red fox jumps over the lazy dog. The end.

You get

+1 added −0 removed ~1 changed --- Original +++ Changed @@ -1,2 +1,3 @@ -The quick brown fox +The quick red fox jumps over the lazy dog. +The end.

This is the unified diff the tool copies. On screen, the words brown and red are highlighted inside the changed line.

Only the indentation changed

You enter

Original: " return total;" Changed: " return total;"

You get

With Ignore whitespace on: The two texts are identical.

With it off, the line is shown as changed.

Good to know

  • Inside an edited line, the exact words that changed are highlighted, so a single typo is easy to spot.
  • Turn on Ignore whitespace to skip changes in indentation and spacing, or Ignore case to treat A and a as the same.
  • Long unchanged stretches are folded away. Click a folded row to show those lines again.
  • Copy the result as a unified diff, the same format git and patch files use.

Limits and disclaimers

  • The comparison works line by line. If a long paragraph sits on a single line, the whole paragraph is one line, and the changed words inside it are highlighted.
  • Moved blocks are shown as removed in one place and added in another, the same way git shows them.
  • Each side can hold up to 1,000,000 characters. If two big texts are almost completely different, the comparison stops after a few seconds rather than freezing the page.
  • Ignore whitespace treats any run of spaces and tabs as one space and ignores spaces at the start and end of lines. Blank lines still count as lines.

ByteKit is provided as is, for convenience. Check any result that matters before you use it in production, and keep passwords, keys and personal data out of any website you do not control.

How to read the diff

What you seeWhat it means
Green lineAdded: the line only exists in the changed text
Red lineRemoved: the line only exists in the original text
Red and green pairChanged: the line was edited, and the edited words are highlighted more strongly
No colourUnchanged: the line is the same in both texts
↕ Show linesA folded run of unchanged lines. Click it to unfold

Compare files from the command line

The same comparison is built into most systems. These commands give you the unified format that Copy unified diff produces.

  • diff -u old.txt new.txtmacOS and Linux: a unified diff of two files
  • git diff --no-index old.txt new.txtAny system with git, even outside a repository
  • git diff --word-diffWord-level changes in a git repository
  • fc old.txt new.txtWindows Command Prompt

Related tools

Questions people ask

Is my text uploaded anywhere?

No. Both texts are compared in your browser and never sent to a server, so it is safe to compare private documents, code and data.

Which algorithm does it use?

The Myers diff algorithm, the same one git uses by default. It finds the smallest set of added and removed lines that turns one text into the other.

Can I compare two files?

Yes. Use Open file above each box to load a text file such as .txt, .md, .json, .csv or source code. The file is read on your device.

Why is a changed line shown as removed and added?

When two lines share almost nothing, highlighting scattered letters would be confusing, so the tool marks the whole line as replaced instead.

What is a unified diff?

A plain-text format that lists removed lines with a minus sign and added lines with a plus sign. It is what git diff prints, with @@ lines that say where each change is and 3 lines of context around it, so it can be applied with patch or git apply, or pasted into an issue, email or chat.

Guides

Longer reads from the ByteKit blog that go with this tool.