Text Diff

About this tool

The GameZone Text Diff compares two versions of a text and shows right away what has changed. Additions appear in green, removals in red, changes in yellow; within changed lines the affected words are highlighted as well. Paste your texts or load text files, and the comparison appears without pressing a button. Both texts stay in your browser and are not sent anywhere. Developers can copy the result as a unified diff or save it as a .diff file.

What you can use it for

Frequently asked questions

How do I compare two texts online?

Paste the old version into the “Original” field and the new one into “Changed”, or load a text file for each. The comparison appears instantly. Red means removed, green means added, yellow means changed.

Are my texts sent to a server?

No. The comparison runs entirely in your browser and the texts are not transmitted anywhere. This matters for confidential documents such as contracts.

What do red, green and yellow mean?

Red marks text missing from the new version, green marks text that was added. Yellow stands for lines that exist in both versions but were modified, with the changed words highlighted inside them.

Can I ignore whitespace and capitalisation?

Yes, in the options. Then differences in spaces and tabs or in upper and lower case do not count as changes. Ignored differences also do not appear in the counts or the export.

What is the difference between line, word and character?

The detail setting decides what is marked inside changed lines: the whole line, single words or single characters. “Word” is the default and usually fits. If two lines are barely related, only the line is coloured.

How do I get a unified diff as a .diff file?

In the “Pro & Export” section you can copy the diff or save it as a .diff file. The format matches diff -u and can be read by Git and patch. The number of context lines around each change is set there.

Does the tool detect moved paragraphs?

No. A moved paragraph appears as a deletion at the old place and an insertion at the new one. This is usual for line-based comparisons.

Is there a size limit?

Yes, there are limits for file size and computation effort. For very large and completely different texts, parts are marked as replaced wholesale, and a note tells you so.

Background

A text comparison, known in technical jargon as a “diff”, answers the question of which changes turn one version of a text into another. The result consists of three kinds of differences: additions, removals and modifications. The principle comes from software development, where the Unix program diff and version control systems such as Git have used it for decades. It is just as useful for any other text, such as contracts, job applications or school work.

The tool first splits both texts into lines and compares them with the Myers algorithm. It looks for the shortest sequence of deletions and insertions that turns one text into the other. Its effort grows with the number of differences, not with the length of the text, so even long texts with few changes are compared quickly. For extreme cases there is a computation limit; when it is reached, parts are marked as replaced wholesale and the result is an approximation.

Lines that appear in both versions and differ only in part are paired up and shown as “modified”. Within those lines you can highlight the whole line, each changed word or each changed character, depending on the detail setting. Emoji and accented characters count as a single character.

The options let you hide differences that are often just formatting. When whitespace is ignored, runs of spaces and tabs count as equal and edges are disregarded, similar to diff -b. Windows line endings (CRLF) and Unix line endings (LF) can be treated alike. A custom pattern given as a regular expression removes matches such as timestamps or IDs before comparing.

Unchanged parts can be folded away so that only the changes and a few lines of context remain visible. The same context width determines the export in unified diff format: it contains context lines and an @@ header for each section, as processed by Git, patch and code-review tools. Two changes further apart than twice the context end up in separate sections.

For prose, a line-based comparison is not always ideal, because a paragraph is often a single long line. Here the word highlighting helps, showing exactly what changed even inside long lines. The overview strip next to the comparison shows all changes across the whole document and works as navigation. Moved sections are not recognised as moves, only as a deletion plus an insertion.

Help & info

How does it compare?

Both texts are split into lines and compared with the Myers algorithm: it finds the shortest sequence of deletions and insertions that turns one text into the other — the same idea as diff and Git. The effort grows with the number of differences, not with text length; even 10,000 lines with a few changes compare instantly. Limits: the comparison is capped at about 20 million steps — for very large and completely different texts the rest is marked as replaced wholesale (a note appears). Moved paragraphs are not detected as moves, only as delete plus insert.

Line, word, character

Lines that appear in both texts and differ only in part are paired up (“modified”). Within them, “Word” marks the changed words, “Character” single characters (emoji and accents count as one), “Line” colours the whole line. If two lines are barely related, only the line colour is used.

What “Ignore” does

Whitespace: runs of spaces and tabs count as equal, edges are disregarded (like diff -b). Case: A and a are equal. Line endings: Windows (CRLF) and Unix (LF) are equal, as is a missing final newline. A custom pattern (regular expression) removes matches before comparing, e.g. timestamps or IDs. Ignored differences appear neither in the counts nor in the export.

The overview strip

The narrow strip on the right shows the whole document top to bottom: Original on the left, Changed on the right. Red = removed, green = added, yellow = modified. The light frame is the visible part — click to jump there, on a mark to jump to that change, drag to scroll along.

Unified diff

The export follows the format of diff -u (context lines and an @@ header per section), as read by Git, patch and code-review tools. Two changes further apart than twice the context start a new section.

Privacy

Both texts stay in your browser, nothing is sent.

N = next change · P = previous · outside the text fields. Dropping a file on a field loads it; two files on one field: first = Original, second = Changed.

⚠️ Bitte beachten

Die Werkzeuge auf dieser Website werden als kostenloses Hobbyangebot bereitgestellt und dienen ausschließlich zur Information und privaten Nutzung. Für die Richtigkeit, Vollständigkeit oder Eignung der Ergebnisse für einen bestimmten Zweck wird keine Gewähr übernommen. Vor Verwendung der Ergebnisse — insbesondere bei finanziellen, rechtlichen oder sicherheitsrelevanten Entscheidungen — sind diese eigenverantwortlich zu prüfen. Eine Haftung für Schäden aus der Nutzung ist ausgeschlossen, soweit dies gesetzlich zulässig ist.