Text Diff Checker
Compare two texts or files line by line and word by word. Ignore case or whitespace, step through each change and copy the result as a unified diff. Everything runs in your browser.
Or drop a file for the original here, up to 5 MB. It isn't uploaded.
Or drop a file for the changed text here, up to 5 MB. It isn't uploaded.
Differences
Paste or open two texts to see what changed.
The patch names the file a/text.txt and b/text.txt, so git apply and patch -p1 can use it.
How to use this tool
Add the two texts
Paste the older version into Original and the newer one into Changed. You can also open a file in either box or drop one on it. Swap flips the two sides if you put them in the wrong order.
Choose what counts as a change
Turn on Ignore case when capital letters don't matter, like for SQL keywords or email addresses. Turn on Ignore whitespace when a file was reindented or reformatted. Both compare cleaned up copies while the view keeps your original text.
Read the differences
Side by side puts the original on the left and the changed text on the right. Inline lists removed lines above added ones, which suits long paragraphs. Changed words are marked inside each line, and long unchanged stretches fold away.
Step through each change
Use the next and previous buttons to jump from one change to the next. The counter shows which change you're on, so you can review a long file without missing an edit.
Copy the unified diff
Set the file name the patch should use, then click Copy as unified diff or download it as a .patch file. It uses the a/ and b/ names that `git apply` and `patch -p1` expect.
About this tool
The Text Diff Checker shows what changed between two versions of a text. Paste a config file, a contract, a list or a query on each side and it marks every removed and added line, plus the exact words that changed inside them.
It's built for the moment you have two copies and need to know the difference: a config that works on one server and not the other, a draft that came back with edits, or a log from a run that failed. When you're done, copy the changes as a unified diff and apply them with git or patch.
The texts never leave your browser. They aren't uploaded, and they stay out of the page URL, so it's safe to compare files with passwords or private data in them.
How the comparison works
The tool compares lines first, using the Myers diff algorithm that git also uses. That gives the smallest set of removed and added lines that turns the original into the changed text. Inside each block of changed lines it runs the same algorithm on words, so a renamed variable or a new date stands out from the rest of the line.
A change is one run of removed or added lines with unchanged lines on both sides. The next and previous buttons stop at each one.
What counts as a change
- Every character counts by default, including spaces and capital letters.
- Ignore case treats upper and lower case letters as equal.
- Ignore whitespace removes all spaces and tabs before comparing, like
git diff -w. A line that was only reindented then counts as unchanged. - Line endings never count, so a Windows copy of a file matches the Unix one.
The switches change what's compared, never what's shown. You always see the text you pasted.
The unified diff
Copy as unified diff gives the format that diff -u, git diff, git apply and patch use. Each section starts with an @@ line that says where it sits in each file. Up to three unchanged lines of context come before and after the edit, removed lines start with a minus sign and added lines start with a plus sign. With an ignore switch on, the patch leaves those ignored changes out, the same as diff -w -u would.
When to use something else
A text diff compares lines, so it sees reordered JSON keys or a reformatted file as changes. To compare two JSON documents by their data, use the compare mode of the JSON Formatter. To check how long a text is after an edit, the Character Counter counts characters, words and lines.
Text comparison guides
Worked examples for configs, documents, lists, logs and patches.
Frequently asked questions
How do I compare two texts?
Is my text sent to a server?
What do Ignore case and Ignore whitespace do?
git diff -w, so a reindented line matches the original. The view still shows both texts exactly as you pasted them.How do I apply the copied diff with git or patch?
git apply --check change.patch to test it, then git apply change.patch to apply it. Without git, patch -p1 < change.patch does the same. Set File name in the patch to the file's path from that folder, like src/config.ts, so both tools find the right file.Why does a whole line show as changed when I edited one word?
Do Windows and Unix line endings count as changes?
How big can the texts be?
Which diff algorithm does the tool use?
--minimal.Related tools
JSON Formatter
Validate, format, and minify JSON. Browse it as a tree, run JSONPath queries, compare two documents, or validate against a JSON Schema.
Use toolCharacter Counter
Count characters, words, sentences, paragraphs, and lines. Check writing limits and count specific characters or phrases.
Use toolText Encoding Converter
Convert text to Base64, binary, hex, URL encoding and HTML entities, and back again.
Use toolLLM Token Counter
Count tokens in any prompt for GPT, Claude, Gemini, and Llama with exact OpenAI tokenization.
Use toolUse this tool on your own site
Drop the Text Diff Checker into your blog, docs, or CMS with one iframe snippet. Free, no signup. See all embeddable tools