Text Diff Checker
Compare two blocks of text and see exactly what changed.
Paste two versions of a file or a block of text and see precisely which lines
were added, removed or left alone. The result is a standard unified diff — the
same format git diff produces — so it can be read by a person or fed
straight to patch.
Useful for working out what changed between two .htaccess files,
two php.ini files, or the config that worked and the one that
does not.
How it works
Comparing two texts sounds trivial until the lines move. A naive line-by-line comparison of two files that differ only by one inserted line at the top reports every subsequent line as changed, which is useless. What you actually want is the longest common subsequence: the largest set of lines appearing in both versions in the same order. Whatever is not in it was either removed from the first or added to the second, and that produces the minimal, human-sensible edit list.
The output here is unified diff format. Each block of changes
is a hunk headed by @@ -start,count +start,count @@, giving the line
ranges in the old and new files. Inside a hunk, a leading - marks a
removed line, + an added one, and a space an unchanged line kept for
context. Three lines of context surround each change, which is what makes a patch
applicable even after the file has shifted slightly.
Two options change what counts as a difference. Ignore whitespace collapses runs of spaces and tabs and disregards leading and trailing space, which is how you see past a reindent. Ignore case compares case-insensitively. Both affect only the comparison — the lines shown are the originals.
One difference this tool does report, and most people forget to look for, is line endings. A file saved on Windows ends its lines with CRLF, one saved on Linux with LF alone. The two look identical in an editor and are entirely different bytes — which is why a shell script uploaded from Windows fails with a "bad interpreter" error. If the two sides differ only in that respect, it is called out explicitly below.
Frequently asked questions
What is a unified diff?
The standard format for expressing changes between two texts, used by git, diff -u and patch. Each hunk states the affected line ranges, then lists removed lines prefixed with -, added lines with +, and unchanged context with a space.
Can I apply this output as a patch?
Yes. Save it to a file and run patch -p0 < changes.diff, or git apply. Edit the two ---/+++ header lines to the real filenames first, as they are placeholders here.
Why does it say the files differ when they look identical?
Almost always invisible characters: Windows CRLF endings versus Unix LF, a trailing space, a tab where spaces were expected, or a UTF-8 byte order mark on one file. The summary flags line-ending mismatches specifically.
Is my text sent to the server?
Yes — the comparison runs in PHP, so both sides are posted. Nothing is stored or logged, but do not paste secrets. For confidential material, use git diff or diff locally instead.
How large can the input be?
Around 3,000 lines per side. The algorithm builds a table proportional to the product of the two lengths, so very large files would use a lot of memory for a page that has to answer in a second or two. Use a local diff for anything bigger.
Does it show differences within a line?
No — this is a line-level diff, so a line with one changed character appears as one removal and one addition. That matches what patch applies. For character-level detail, look at the pair of lines directly, or use git diff --word-diff.
Related tools
JSON Formatter
Format, validate and minify JSON with precise error locations.
Developer UtilitiesBase64 Encode / Decode
Encode text to Base64 or decode it back, including URL-safe Base64.
Developer UtilitiesCase Converter
Convert text to camelCase, snake_case, kebab-case, Title Case and more.
Developer UtilitiesURL Encode / Decode
Percent-encode text for URLs, or decode it back — RFC 3986 and form encoding.
Developer UtilitiesHash Generator
Generate MD5, SHA-1, SHA-256, SHA-512, SHA-3 and CRC32 hashes at once.
Developer UtilitiesRegex Tester
Test a PCRE pattern against your text and see every match and group.
Developer UtilitiesNeed hosting that just works?
Free SSL, daily backups and 24×7 support on every Loudhost plan.