Diff two files

Compare two versions of a text file and see exactly which lines were added and which were removed.

or drop them here · files stay on your device · pick at least 2
We count formats and sizes. Filenames stay private unless you opt in.

Show unchanged lines
Processed on this device
  • Runs on your device
  • No sign-up or watermark
  • No fixed file size cap

The short answer

To compare two text files, choose both here and click Compare them. A line-by-line diff runs in your browser and marks each line as added (+), removed (-) or unchanged, with totals for each. Neither file is uploaded, so contracts, configs and code stay private. The result downloads as changes.diff.

How to compare two text files and see the differences

  1. STEP 1

    Choose the original first

    Select the older file, then the newer one. Any text format works: .txt, .json, .csv, .md, .js, .css or .html.

  2. STEP 2

    Decide on context

    Leave Show unchanged lines on to read changes in place, or turn it off to list only what changed.

  3. STEP 3

    Compare them

    The report shows lines added, removed and unchanged, or says the two files are identical.

  4. STEP 4

    Save the diff

    Read it in the preview or download changes.diff to keep or share the listing.

How a line diff works

A diff finds the longest run of lines the two files share, in order, and reports everything else as removed from the first file or added in the second. A changed line therefore shows up as one removal and one addition, which is how git and most diff tools present it.

Line diffs suit code, configuration, CSV exports and plain text. They are less helpful for prose that has been rewrapped, where one edited word can reflow a whole paragraph onto new lines.

What survives, and what does not

Both files are split into lines, with Windows and Unix line endings treated the same, and compared with a longest-common-subsequence algorithm. Output uses diff-style prefixes: + for added, - for removed and a space for unchanged. Turn off Show unchanged lines to see only what changed. Order matters: the first file chosen is the original.

What you keep

Exact line-level differences, including changes to whitespace inside a line

Counts of lines added, removed and unchanged

Both originals, untouched on your disk

What you lose

Differences within a line are not highlighted; a changed line shows as one removed and one added

Line-ending differences (CRLF against LF) are ignored, by design

The output is a plain +/- listing, not a unified diff with @@ hunk headers, so it will not apply as a patch

Very large files are slow and memory-hungry, since the comparison grows with lines in one file times lines in the other

Honest limits are published on every tool page. If a tool cannot do something well, it says so here rather than letting you find out after the download.

Diff two files at a glance

InputTwo text files (TXT, JSON, CSV, MD, JS, CSS, HTML)
Outputchanges.diff, a +/- line listing
GranularityLine by line
AlgorithmLongest common subsequence
Runs onYour device, in the browser
Works offlineAfter the first use

If something goes wrong

Every line shows as changed

One file probably has different indentation, trailing spaces or tabs throughout. Normalise them in your editor first, then compare again.

Additions and removals are the wrong way round

The first file you select is treated as the original. Choose different files and pick the older one first.

The tab becomes slow on big files

The comparison needs memory proportional to both line counts multiplied together. Split very long logs or exports into smaller parts first.

Diff two files questions

How do I compare two text files for differences?

Choose the original and the new version here and click Compare them. Added lines start with +, removed lines with -, and totals appear in the report.

Is there a private diff checker that does not upload files?

This one compares the files inside your browser tab. Nothing is sent to a server, so it is safe for contracts, credentials files and unreleased code.

Does it show changes within a line?

No, it works at line level. A line with one character changed appears once as removed and once as added, with both versions shown.

Can I compare two Word or PDF files?

Not directly; it reads plain text. Convert the documents to text first, then compare the text files.

Does it ignore Windows versus Unix line endings?

Yes. CRLF and LF are treated as the same, so a file saved on Windows will not show every line as changed. Use Change line endings if you need to fix that difference itself.

Can I compare files on a Mac or iPhone?

Yes. It runs in Safari, Chrome, Firefox and Edge on any device, as long as you can pick both files from Files or Finder.

One of 153 file tools and planned additions. Built and tested by Arin Prajapati, last checked against the code on . canonical: https://damnfiles.com/diff-files
Analytics preferences

Help us understand which tools and file types people use. File contents always stay on your device.

Filename sharing is optional and off by default. Names can contain personal information. Changes apply to future events; disabling sharing does not delete earlier records.

Read our privacy policy