About Diff Checker
Two versions of a config, two API responses, or the contract your colleague sent back: you need to know what is different and nothing else. Paste them side by side and you get the changed lines marked, with the exact words highlighted inside each one, and long runs of matching lines folded out of the way.
The options are for the noise you do not care about. Ignore whitespace stops reindenting from looking like a rewrite, and Ignore case does the same for capitalization. When you have what you need, copy or download the result as a unified diff, the format code review tools and the patch command understand.
How it works
Lines are compared with Myers' algorithm, the default behind git diff. It finds the shortest set of edits, so adding one line near the top does not make all the lines below look changed. Line endings are normalized first, and a missing final newline is not counted as a difference, so a file saved on Windows compares cleanly with the same file from Linux.
When a removed line pairs up with an added one, a second pass compares their words and marks only those that differ. Dotted and hyphenated values stay whole, so 0.0.0.0 to 127.0.0.1 reads as one changed value. Ignore options affect the comparison only: the text you see, and the text in the patch, is always the original.
How to use Diff Checker
- Paste the older text into Original and the newer into Changed. Each side has Upload and Paste buttons, and you can drop a file on a box. Try an example fills both.
- Press Compare. Short texts also update as you type.
- Turn on Ignore whitespace or Ignore case if those differences do not matter, and switch between Side by side and Unified.
- Use a Show unchanged lines button to open a folded section, then Copy patch, or Download .patch to save
changes.patch.
The patch for a small config change
Original:
host: 0.0.0.0
port: 8080
debug: true
name: api
Changed:
host: 127.0.0.1
port: 8080
name: api
retries: 3--- original
+++ modified
@@ -1,4 +1,4 @@
-host: 0.0.0.0
+host: 127.0.0.1
port: 8080
-debug: true
name: api
+retries: 3Applying this patch with patch yourfile.txt changes.patch gave back the changed text exactly. The headers say original and modified, so name the target file yourself when you apply it.
When it helps
- Finding what changed between the staging and production copy of a config
- Comparing two API responses after formatting both, to spot a changed field
- Checking what was edited in a contract or a piece of text someone returned
- Preparing a small patch to send to someone who is not using your repository
Tips for a better result
- Format structured data first. Minified JSON is one long line, so run both sides through the JSON Formatter with sorted keys and the differences become clear.
- Swap sides reverses the direction, which is quicker than pasting again if you got them the wrong way round.
- A patch made with an ignore option on can fail to apply, since its context lines come from one side only. Turn the options off before making a patch for real use.
Good to know
- It compares lines and words, not meaning, so a moved block appears as one removal and one addition.
- When two texts differ by more than 3,000 lines of edits, the changed part is shown as one block removed and one added, with a note.
- At most 5,000 changed rows are drawn on the page. The patch still includes them all.
- It reads text only. Files above 5 MB, or binary files such as Word documents and images, are refused.
Questions people ask
Why does it say the texts are identical when the files differ?
They differ only in line endings or a final newline, and this tool treats those as the same on purpose. A message tells you when that is what happened.
Can I use the patch with git?
It is a standard unified diff that the patch command applies. git apply wants file paths in the headers, so you would need to edit those two lines first.
Why is a whole line marked with no highlighted words?
Word marks appear only when the two lines share enough text to make them helpful, roughly a third or more. Below that, one line is shown as removed and the other as added.
What does unified view show that side by side does not?
The same changes in one column, with old and new line numbers side by side. It takes less width, so it works better on a phone, and it matches what a patch looks like.
What to use next
- JSON Formatter: to normalize JSON before comparing it
- SQL Formatter: to line up two queries before comparing them
- Hash Generator: for a quick yes or no on whether two files are the same
Last reviewed . Read our editorial policy.