From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
Kompare icon.svg
A screenshot of Kompare
A screenshot of Kompare
Stable release20.04.2 (11 June 2020; 53 days ago (2020-06-11)[1]) [±]
Repository Edit this at Wikidata
Written inC++
Operating systemCross-Platform
TypeDiff and Merge Tool
Websitewww.caffeinated.me.uk/kompare/ Edit this on Wikidata

Kompare (formerly "Kdiff") is a graphical diff and merge tool targeting developers. It allows users to compare two different text files or two directories. It is part of KDE Applications (and formerly part of KDE Software Compilation) and therefore primarily used on Linux and other Unix-like operating systems, as well as Windows. Kompare does not actually compute the differences between the compared files itself, but is merely a graphical front end to the command line interface diff utility.

It is a standard KDE SC tool, it comes packaged with the kdesdk module.

Comparing text files[edit]

Kompare displays the two compared files next to each other in a way that corresponding lines are always positioned as near to each other as possible, independent of the position of the scrollbar. Lines that are different in the compared files are highlighted in both file views. Three different colors are used for highlighting, indicating whether the highlighted passage either

  • exists in the first file but not in the second one (i.e. the highlighted passage has been deleted from the second file); or
  • exists in the second file but not in the first one (i.e. it has been added to the second file); or
  • exists in both files but is different (i.e. it has been changed in the second file).

Other features of Kompare[edit]

An incomplete list of features Kompare supports additionally to comparing text files follows.

Comparing directories[edit]

When two directories are chosen to be compared instead of two text files, Kompare displays a directory tree for both selected directories, which contains only pairs of corresponding files and directories that are not equal in the two compared directories. Clicking on an entry displays a comparison of the two selected files.

Creating and applying patches[edit]

Kompare is able to create a patch file which lists only the differences between two compared text files A and B. Further, Kompare can apply a patch file which was created this way to an original file A and, in this manner, recompute the contents of the corresponding file B. This is a comfortable utility for passing a corrected version of a file to a friend who already has an older version of the same file, because only the (relatively small) patch file has to be delivered and the receiver can generate the corrected file by applying the patch to the original file.

The patches created and applied by Kompare are compatible with patch files generated or applied by the command line interface diff utility, because Kompare is in fact merely a graphical front end to diff and the patches are created and applied by patch, which gets called by Kompare.

See also[edit]

  • Comparison of file comparison tools
  • meld visualizes differences very much like Kompare, but also allows merging files and editing details of the text.
  • FileMerge presents file differences using a style very similar to Kompare.
  • WinMerge, a similar free software tool for Microsoft Windows.


  1. ^ "KDE's June 2020 Apps Update". KDE. 11 June 2020. Retrieved 13 June 2020.

External links[edit]