What a text compare tool does
A text compare tool, also called a diff tool, lines up two versions of a text and marks what changed between them. It finds the longest stretch the two versions share, treats everything else as an addition or a removal, and shows the result so you do not have to read both versions side by side by eye. It is useful for checking an edited draft, a contract revision, a translation update, a configuration file or two pieces of code.
Before
It was a sunny day. The dog slept.
After
It was a sunny day. The sleepy dog slept. The birds sang.
Line, word or character
- Line mode compares whole lines. It is the right choice for code, lists and files, and it is the fastest.
- Word mode finds changes inside a sentence, so one swapped word does not mark the whole line as changed.
- Character mode shows the smallest changes, such as a typo fix. It is limited to shorter texts, and the tool tells you when to switch to word or line mode.
Options
Ignore case treats capital and small letters as the same. Ignore whitespace differences collapses runs of spaces and tabs before comparing lines, so a reformatted paragraph does not light up. Ignore blank lines removes empty lines from both texts first. Together they let you focus on changes in meaning rather than formatting.
Reading the results
The summary shows how many lines, words or characters were added, removed and left unchanged, plus a similarity percentage. The percentage is twice the unchanged part divided by the total size of both texts, so two identical texts score 100 and two completely different texts score 0. Added and removed text is marked with a plus or minus sign, an underline or a strikethrough, and not by color alone.
Copying and sharing the diff
The unified diff is the plain text format used by version control tools: a header, then sections that start with @@ and list the lines that changed, with three unchanged lines around each change. You can paste it into an email, a ticket or a code review. To clean up pasted text before comparing, try the line break remover, or the duplicate line remover when comparing lists.
When two texts are completely different, the tool simplifies the comparison and says so, because finding the smallest set of changes would take a very long time. Switching to line or word mode usually gives a clearer picture.