Code & Text Diff

Compare two versions of code or text, view differences and download Patch files

Original Text

Enter original text

or drag and drop a file

New Text

Enter new text

or drag and drop a file

Comparison Result

0 added 0 removed 0 modified 0 unchanged

About This Tool

Put two versions of a text or code file side by side and see exactly what was added, removed, or changed. Paste the old version in the first box and the new one in the second; the result is built right away, with line numbers and color coding. No install, no sign-up.

It earns its keep whenever you have two versions of something and can no longer remember which one you edited: a file a colleague touched, a contract the other side sent back, product copy before and after a review, a config file that worked yesterday and not today, or a list of codes that has to match the previous batch.

You can paste text or drop a file onto either box, swap the two sides with one button, see how many lines were added, removed, changed, and left untouched, and download a patch file with all the differences. Your text never leaves your device and nothing is stored.

Frequently Asked Questions

How do I compare two versions of a file?
Paste the older version into the "Original Text" box and the newer one into the "New Text" box. If you have files, drop each one onto the matching box and its contents are read in. The result is built without pressing any button.
Which files can I drag and drop?
Plain-text files with the extensions txt, js, css, html, php, json, and md. Formats like Word or PDF have no raw text layer, so copy the text out of the app and paste it into the box instead.
What do the colors and the numbers above the result mean?
Green with a + marks an added line, red with a − marks a removed one. A line that changed takes two rows: first the old version in red, then the new one in green. The four numbers above the result count exactly those groups: added, removed, changed, and unchanged lines that are identical in both versions.
Does it highlight differences inside a single line?
Yes. When a line differs by only a few characters, the changed part is highlighted inside the line so you do not have to re-read the whole thing.
What does the Swap button do?
It switches the original and the new text. If you pasted the newer version on the left and everything reads backwards, one click fixes it.
What is a patch file and why download it?
It is a plain-text file holding only the differences in a standard format. It is handy for sending changes to a colleague, attaching to a ticket, or archiving a record of what changed. The "Download Patch" button saves it.
Does it handle non-English text correctly?
Yes, Persian, Arabic, and any other Unicode text are supported. Keep in mind that visually similar letters from different keyboard layouts are different characters, so they will be flagged as differences.
The two texts look identical but differences are reported. Why?
Usually invisible characters: a trailing space, a tab where the other side has spaces, a zero-width character, or an extra newline. Your eye skips them; a line-by-line comparison does not.
Can I compare programming code?
Yes. HTML, CSS, JavaScript, PHP, Python, SQL, JSON, and config files all work. The comparison is line based and does not depend on the language.
My texts are very long and it feels slow. What can I do?
Split the input into smaller chunks and compare one at a time, for example a single file rather than a whole project. Very long inputs still produce a result, the browser just needs a moment longer.
How do I clear everything and start over?
The "Clear All" button empties both boxes and the result. To replace just one side, use the Clear button above that box.
Is my text stored or visible to anyone?
No. The comparison runs on your own device, the text and files you drop never leave it, and nothing is kept. Closing the page wipes everything.
Do you have tools for counting words or taking notes?
Yes. Use the Text Analyzer for character and word counts plus SMS and social character limits, and the Notepad for writing and keeping text.
Was this tool helpful?
4.7out of 5
Thanks for your feedback!

Related tools

Home