Text Compare and Diff Checker

Paste two versions of a text or open two files and see exactly what changed, line by line, word by word and letter by letter. Everything runs in your browser and nothing is uploaded.

Texts to compare

Paste text or drop a file on a box (or pick two files at once). Works with .txt, .md, .csv, .json, .html, .xml, source code and the text of .docx files. Files stay on your device.

Comparison options

Differences

Use the arrows beside a changed block to copy it to the other side. Keys: N for the next change, P for the previous one.

How to compare two texts

This text compare tool is a diff checker: it shows what was added, removed or changed between two versions of the same text. Put the older version on the left and the newer one on the right, and the differences appear below as you type. There is no Compare button to press.

  1. Paste or type into both boxes, or press Open file to load a file into each. You can also drop a file onto a box, or select two files at once.
  2. Read the result in Side by side view. On a phone, Inline is easier: removed and added lines are stacked in one column.
  3. Press Next (or the N key) to jump from change to change. The counter shows where you are.
  4. Use the arrows beside a changed block to copy it to the other side. Undo puts both boxes back as they were.

The example text in the boxes only shows how the tool works. It disappears as soon as you type or open a file, and it is never saved.

What the colours mean

You seeIt means
Red line on the leftThis line exists only in the original. It was removed.
Green line on the rightThis line exists only in the changed text. It was added.
Red and green on the same rowThe line was edited. Darker patches inside it mark the exact words or letters that differ.
Striped empty cellThe other side has no matching line here.
Bar saying "40 unchanged lines"Identical lines folded away. Click it to show them, or untick Hide unchanged lines.

When a block of lines was rewritten, the tool pairs each old line with the new line that looks most like it, so you see the edit inside the line instead of one big red block and one big green block. That pairing is a best guess based on how similar the lines are, and when lines were both edited and moved it can pair the wrong ones.

Ignoring differences you do not care about

OptionTreated as equal
Ignore caseError and ERROR
Ignore whitespacetotal = 5 and total=5. All spaces and tabs are removed before comparing.
Trim lines total and total. Only the spaces at the start and end of a line are ignored.
Ignore blank linesEmpty or whitespace-only lines are skipped, so an inserted blank line is not a change.
Compare as wordsThe texts are compared as a stream of words, ignoring line breaks and spacing.

Compare as words is the one to use when a paragraph was re-wrapped. Text copied out of a PDF breaks lines at the page width, so a line diff against the original marks nearly every line. A word diff only shows the words that really changed.

Comparing code, JSON and CSV

For code, leave Ignore whitespace off unless indentation does not matter. It does in Python and YAML, where moving a line one level in changes what the file means.

For JSON, press Format JSON (sort keys) first. It pretty-prints both boxes with two-space indentation and sorts the keys alphabetically, so an object whose keys were only reordered shows no difference. Numbers above 9,007,199,254,740,991 lose their last digits when JSON is parsed in a browser, so skip this step for IDs that large.

For CSV, every row is a line. If a column was inserted near the start, every row differs, and the highlights inside each row show where the new value sits.

What is inside a .diff file?

The download is a unified diff, the format git diff prints. A small one looks like this:

--- original +++ changed @@ -2,3 +2,3 @@ Meeting notes -Budget: 4,500 USD +Budget: 5,000 USD Deadline: end of April

The first two lines name the files. @@ -2,3 +2,3 @@ says the block starts at line 2 and covers 3 lines in each file. A line starting with - was removed, one starting with + was added, and a space marks an unchanged line kept for context. Each block carries three lines of context. Most code review tools read this format, and the patch command applies it: patch original.txt changes.diff.

If you ticked an ignore option, the patch leaves those differences out, so applying it may not give back the right-hand text exactly. The HTML report is a single page with the same side-by-side view and the statistics, which you can email or print.

Limits to know about

Frequently asked questions

How do I compare two texts online?

Paste the original into the left box and the changed version into the right box. The differences appear straight away below: red for removed text, green for added text. For files, press Open file on either side or drop them on the boxes. Nothing is uploaded.

What does the diff checker highlight?

It marks whole lines that were added, removed or changed, and inside a changed line it marks the exact words and letters. Changing colour to color highlights only the letter u. You can switch the inner highlighting to whole words or turn it off.

Can I compare two files, such as .txt, .csv, .json or code?

Yes. Any plain text file works, including .txt, .md, .csv, .json, .html, .xml and source code in any language. For Word files, the text of a .docx is read, but formatting, images and comments are ignored. PDFs, images and spreadsheets are not supported.

Is my text uploaded to a server?

No. The comparison runs in your browser, in a background thread, and the files you open are read on your device. Nothing is sent anywhere, so it is safe for contracts, source code and private notes.

How do I ignore whitespace or capital letters?

Tick Ignore whitespace to treat "a b" and "ab" as equal, Trim lines to ignore spaces at the start and end of each line, Ignore case to treat Hello and hello as equal, and Ignore blank lines to skip empty lines. The options combine.

How many lines can it compare?

Texts with tens of thousands of lines are fine. A 20,000-line file with a few hundred edits compares in a fraction of a second, and the page stays responsive because the work happens in a background thread. Files over 25 MB are refused.

How do I save the differences as a patch file?

Use Download .diff or Download .patch for a unified diff with three lines of context, the same format git diff and the patch command use. The HTML report is a standalone page you can email or print, and Copy diff puts the unified diff on your clipboard.

What does Compare as words do?

It ignores line breaks and spacing and compares the two texts as a stream of words. That suits prose that was re-wrapped, for example a paragraph pasted from a PDF, where a line diff would mark every line as changed.