utilyfe

Text Diff

Paste two versions, or drop in two files, and see exactly which lines (and which words) changed.

Runs entirely in your browser. Nothing you enter is uploaded or stored.

How to use the Text Diff

  1. 1Paste the original on the left and the changed version on the right, or drop a text file onto either box (or click "Load a file").
  2. 2Read the summary line for how many lines were added, removed or changed.
  3. 3Switch between side by side and unified, whichever reads better for your text.
  4. 4Turn on Ignore case or Ignore whitespace when those differences don't matter.
  5. 5Press "Download .diff" to save the comparison as a unified diff file, the format git and code review tools read.

Pasting or loading a file

Either box takes text directly, or a whole file: drop it on the box, or click “Load a file” above it. The file is read by your browser and never leaves the page: there’s no upload step, so a config file or a log with real data in it stays private the same way pasted text does.

How the comparison works

The two versions are split into lines, and the tool looks for the longest common subsequence: the largest set of lines that appear in the same order on both sides. Everything in that set is unchanged; everything else was added or removed.

That’s the same idea behind diff and git, and it’s why a diff can tell that you inserted a paragraph in the middle rather than rewriting everything after it.

One extra step makes the result readable. Where a run of removals meets a run of additions, they’re paired up in order (first with first, second with second) and each pair becomes a changed line, compared again word by word. A sentence where you swapped one word shows that one word highlighted, not the whole line. Anything left over when one side is longer stays a plain addition or removal.

Side by side, or unified

Side by side shows the two versions in columns, aligned so unchanged lines sit level with each other. It suits prose, short documents, and anyone comparing “before and after”.

Unified stacks the old line above the new one in a single column, marked − and +. It’s what git, GitHub and code review tools show, it wastes no horizontal space, and it’s much easier to read on a phone.

When “identical” text isn’t

Two files that look the same can differ in ways nothing on screen shows:

  • Line endings. Windows ends lines with CRLF, Unix with LF. This page normalises them before comparing, so they never show as false differences, and the summary tells you when that was the only difference.
  • Trailing spaces. Invisible, and enough to make every line differ. Turn on Ignore whitespace, and the summary will point out when trailing spaces were the only change.
  • Byte-order marks. A three-byte marker some editors put at the start of a file.
  • Look-alike characters. A non-breaking space, a curly quote pasted from a word processor, or a Cyrillic “а” in an English word.

The options

Ignore case treats Hello and hello as the same line. Useful for comparing headings, keys or anything where capitalisation isn’t meaningful.

Ignore whitespace trims each line and collapses runs of spaces and tabs, so re-indented code or re-wrapped text doesn’t drown the real changes.

Both options affect the comparison, not the display: you still see your text exactly as you pasted it.

Questions

Is my text uploaded anywhere?
No. The comparison runs in this browser tab, which matters when you're diffing a contract, a config file or a log extract. Nothing is uploaded, logged or saved, and refreshing the page clears both boxes.
It says the text is identical, but the files aren't. Why?
Usually invisible characters. Windows line endings (CRLF) versus Unix (LF), trailing spaces at the ends of lines, or a byte-order mark at the start. Line endings are normalised here before comparing, and when the only difference is trailing whitespace the summary says so explicitly.
What's the difference between the two views?
Side by side puts the versions in two columns, which suits prose and short files. Unified stacks removals above additions in one column, the way git and code review tools show a patch, which is easier to follow on a phone or for long files.
Why are some lines highlighted word by word?
When a line is replaced rather than simply added or removed, the two versions are compared again word by word, so you see the few words that actually changed instead of a whole highlighted line.
Can I compare two files instead of pasting?
Yes: drop a text file onto either box, or click "Load a file" above it, and its contents fill that side. It's read directly by your browser, so nothing is uploaded. This reads plain text (code, Markdown, CSV, logs, config files and the like); it doesn't extract text from a PDF or an image.
Can I save the comparison?
Yes. "Download .diff" gives you a unified diff: the same format as `git diff`, so you can attach it to a ticket, paste it into a review, or apply it with `git apply`. The file is written by your browser; nothing is uploaded.