Skip to content

Text diff

Compare two text files and download a standard unified diff.

difftextcompare

Upload

Files (2–2)
Two text files, up to 2 MB each. The FIRST file is the original; the SECOND is the modified one.

Options

Context lines 0–20 lines Unchanged lines kept around each change in every hunk.
Name for the original
Name for the modified
Questions people ask
Which file is the original?
The order you add them. The first file is the original (the 'before'); the second is the modified (the 'after'). The list under the drop zone shows the comparison order.
Are CRLF and LF treated as different?
Yes, by default: the comparison is byte-faithful, so a line whose only change is its line ending shows up as a change. Choose "normalize" to compare with line endings unified (the diff itself is then emitted with LF only); a pair that differs only by endings reports identical.
What about a file with no newline at the end?
It is handled the way git does: the diff shows the "No newline at end of file" marker right after the affected line, on the side that lacks the terminator. Adding or removing that final terminator is a real, visible difference.
Can the diff be applied with patch tools?
The output is a standard unified diff with count-annotated hunks. The file headers carry your chosen labels (sanitised: control characters become spaces and leading dashes are stripped so a header can never look like a command-line option) and deliberately no timestamps.
What if one file is not valid UTF-8?
You get a diagnostic naming the side and the exact position, never a partial diff and never the raw bytes: a diff of a document that could not be read would be fabrication.
What if the files are identical?
A success: you get an empty .diff and an "Identical" verdict in the result; nothing is fabricated.