The KDiff3 Handbook
KDiff3 is a file and directory diff and merge tool which
compares and merges two or three text input files or directories,
shows the differences line by line and character by character(!),
provides an automatic merge-facility,
has an editor for comfortable solving of merge-conflicts,
provides networktransparency via KIO,
and is very colorful (by default) :-)
This document describes KDiff3-version 0.9.70.

Introduction

Yet Another Diff Frontend?
Several graphical diff tools exist. Why choose KDiff3? Let me say, why I wrote it.
KDiff3 started because I had to do a difficult merge. Merging is necessary when several people work on the same files in a project. A merge can be somewhat automated, when the merge-tool not only has the new modified files (called "branches"), but also the original file (called "base"). The merge tool will automatically choose any modification that was only done in one branch. When several contributors change the same lines, then the merge tool detects a conflict which must be solved manually.
The merge then was difficult because one contributor had changed many things and corrected the indentation in many places. Another contributor also had changed much text in the same file, which resulted in several merge conflicts.
The tool I used then, only showed the changed lines, but not what had changed within these lines. And there was no information about where only the indentation was changed. The merge was a little nightmare.
So this was the start. The first version could show differences within a line and showed white space differences. Later many other features were added to increase the usefulness.
For example if you want to compare some text quickly, then you can copy it to the clipboard and paste it into either diff window.
A feature that required a big effort was the directory comparison and merge facility, which turned the program almost into a full file browser.
I hope KDiff3 works for you too. Have fun!
Joachim Eibl (2003)

Screenshots and Features
This screenshot shows the difference between two text files
(Using an early version of KDiff3):
3-way-merging is fully supported. This is useful if two people change code independently. The original file (the base) is used to help KDiff3 to automatically select the correct changes. The merge-editor below the diff-windows allows you to solve conflicts, while showing you the output you will get. You can even edit the output. This screenshot shows three input files being merged:
KDiff3 also helps you to compare and merge complete directories. This screenshot shows KDiff3 during a directory merge:

More Features

Line-By-Line And Char-By-Char Diff-Viewer
By using the possiblities of a graphical color display KDiff3 shows exactly what the difference is. When you have to do many code-reviews, you will like this.

See White-Space Differences At One Glance
Spaces and tabs that differ appear visibly. When lines differ only in the amount of white space this can be seen at one look in the summary column on the left side. (No more worries when people change the indentation.)

Triple-Diff
Analyze three files and see where they differ.
The left/middle/right windows are named A/B/C and have the blue/green/magenta color respectively.
If one file is the same and one file is different on a line then the color shows which file is different. The red color means that both other files are different.

Comfortable Merge Of Two Or Three Input Files
KDiff3 can be used to merge two or three input files and automatically merges as much as possible. The result is presented in an editable window where most conflicts can be solved with a single mouseclick: Select the buttons A/B/C from the button-bar to select the source that should be used. You can also select more than one source. Since this output window is an editor even conflicts which need further corrections can be solved here without requiring another tool.

And ...
Fast navigation via buttons.
A mouse-click into a summary column sync's all windows to show the same position.
Select and copy from any window and paste into the merge result window.
Overview column that shows where the changes and conflicts are.
The colors are adjustable to your specific preferences.
Adjustable Tab size.
Option to insert spaces instead of tabs.
Open files comfortably via dialog or specify files on the command line.
Search for strings in all text windows. Find (Ctrl-F) and Find Next (F3)
Show the line numbers for each line.
Paste clipboard or drag text into a diff input window.
Networktransparency via KIO.
...