Opening files and folders

WinMerge provides several ways to specify paths and open files or folders:

1. Select Files or Folders dialog

Quick start describes the Select Files or Folders dialog. This section provides more details, and some tips for using the Select Files or Folders dialog more efficiently.

1.1. Using environment variables

You can use environment variables in your paths. Windows expands the variable name between % (percent) delimiters. For example, if an environment variable named WORKDIR has the value c:\workfiles, then the path %WORKDIR%\project1 is expanded to c:\workfiles\project1 .

1.2. Opening archive files

WinMerge archive support is provided in the 7-Zip plugin. See Getting and installing WinMerge to install this plugin.

Opening two archive files is similar to opening normal files: specify two archive files in the Open-dialog's 1st and 2nd fields. If WinMerge recognizes the archive format, it opens the contents of the archive files in the Folder Compare window.

The Comparing and merging folders topic describes how to work with archive files. For example, if an archive file contains two subfolders named Original/ and Altered/, you can compare the contents of the two subfolders by specifying the same archive file in both sides in the Select Files or Folders dialog or WinMerge command line.


When you drag an archive file to the WinMerge window, press Shift when dropping the file: WinMerge automatically copies the same filename to both sides and opens the archive file.

1.3. Applying filters

The Filter edit field enables you to restrict the files to be included in your folder compare. You can specify one or more file masks, or a single file filter (not both).

A mask is a simple expression based on file extensions. For example, this list of file masks includes only files with the specified extensions; all others are excluded from the selection when the compare operation starts:


File masks are practical for simple filtering; for more advanced selecting, use filter files. Filter files are collections of regular expressions that can either include or exclude files. WinMerge installs a number of predefined filter files in its Filters folder, and you can create your own, too.

To specify a filter, click the Select button next to the Filters field to choose from a list of available filters. Or, click the Filter drop-down list and choose a recently-used filter file.

For full information about filter masks and filter files, see Using Filters.

1.4. Selecting an unpacker for file comparisons

Unpackers are plugins that are installed with WinMerge to provide functionality that is not used by default. Plugins that can be used to preprocess certain types of files before comparing them. For example, WinMerge cannot normally compare MS Word doc files, but by unpacking them, you can compare just the text contents. See Plugins for details.

To apply a plugin to your file comparison, click the Select button for the Unpacker option. In the Select Unpacker dialog:

  1. Configure automatic plugin selection or choose a plugin manually:

    • To use automatic mode (which applies the first available plugin), verify that <Automatic> is displayed in the File unpacker control.

    • To choose a different plugin (if available), use the File unpacker control to choose the plugin.

      By default, this control lists only suggested plugins for the file type you selected to compare. To see all available plugins, enable the option, Display all packers, don't check the extension.

    • To launch the compare without using any plugin, choose <None> in the File unpacker control.

  2. Click OK to close the Select Unpacker dialog.

Your choice is displayed in the Unpacker field. Note that you cannot select an unpacker when launching a Folder Compare operation.

2. Launching WinMerge operations in Windows Explorer

The optional Windows shell integration enables you to run WinMerge compare operations directly from Windows Explorer, using WinMerge shortcuts in the context menu.

2.1. Enabling the Windows Explorer integration

The Windows Explorer shell integration is available only if enabled. You can enable it either during WinMerge installation or later, using the Shell Integration page in the Options window. In the Options window, configure the Add to context menu option, including its suboptions if you like.

2.2. Using the WinMerge shortcut

If you enable Add to context menu without the advanced menu suboption, the WinMerge shortcut is added to the Explorer context menu. For example:

To use the basic shell integration, begin by selecting two paths in Windows Explorer. Then, right-click and choose WinMerge in the context menu. For example:

WinMerge command in Windows Explorer context menu

WinMerge opens the paths directly in the File Compare or Folder Compare window.

The left and right sides are determined by the sort order in Windows Explorer. In the preceding screenshot, the Windows Explorer file list is in ascending order, so WinMerge opens with File2 on the 1st side and File1 on the 2nd..


If either path cannot be opened for any reason, WinMerge opens the Select Files or Folders dialog, where you can specify new paths. Similarly, if you select only a single path, the Select Files or Folders dialog opens with the selected file or folder in the 1st field, leaving the 2nd path for you to specify.

The WinMerge shortcut is quick and easy to use, but you can compare only files or folders that you are able to select concurrently in Windows Explorer. For more flexible selections, consider enabling the advanced menu, described in the next section.

2.3. Using the advanced menu

If you choose the Enable advanced menu, the WinMerge shortcut is replaced with two Compare shortcuts:

Advanced WinMerge context menu

Use the Compare shortcuts in this order:

  1. Right-click the first path and choose Compare To. WinMerge stores the path in memory until you select the second path.

  2. If you decide that you have chosen the wrong first path, you can change it before choosing the second path:

    Right-click the new path and choose the Re-select First shortcut. The new selection overrides your previous path, and you can go on to the next step.

  3. Navigate to the second file or folder that you want to compare. The second path can be in any folder, or even in a different Windows Explorer window from the first path. Right-click the second path and choose Compare.

    WinMerge opens the File Compare or Folder Compare window, loading the first and second paths in the 1st and 2nd sides, respectively.


If you click Compare before designating the first path, the Select Files or Folders dialog is opened, with your selection as the first (1st) path. Specify the second path in the 2nd field to continue with the comparison.

The Compare To paths is stored in memory until WinMerge is opened. As a result, you don't need to select both files at the same time or even using the same Windows Explorer view: you can choose one, open a different directory, and choose the other one. Both paths are discarded from memory after a compare operation. This means that you cannot select one Compare To path and compare it against several paths.

2.4. Including subfolders when using the Windows Explorer integration

By default, folder compares that you do using the WinMerge or Compare shortcut are recursive. There is a way to launch non-recursive compares with the Windows Explorer integration:

  • Disable Include Subfolders in the Folder page of the WinMerge Options dialog.


Press Ctrl while selecting the WinMerge or Compare shortcut in the Windows Explorer context menu to force a reverse comparison with the current 'Include Subfolders' settings.

3. Using Drag and drop

From any Windows source that allows you to drag objects, such as Windows Explorer or the Desktop, you can drag and drop one or two paths into the WinMerge window. If you drop only one path into WinMerge, the Select Files or Folders dialog opens for you to select the second path. If the single path specifies a project file, then the project file is opened.

By default, WinMerge does include subfolders in compare operations. To not include subfolders, press and hold Ctrl while dropping paths. Another useful key when dropping paths is Shift: To open the same path in both sides of a Compare window, press and hold Shift while dropping only one path. This is a handy way to open archive files (see Opening archive files).

You can drop paths into the Select Files or Folders dialog. A typical procedure is to drag and drop the first path into the WinMerge window, and then drag and drop the second path into the Select Files or Folders dialog. When a path is dropped into the Select Files or Folders dialog, it is loaded into either the 1st or 2nd path field:


If the 1st field is empty or both path fields already contain paths


If the 1st path is not empty and the 2nd path is empty

4. Project files

You can save the currently open paths and filters in a project file. Then, you can easily open the project later to compare the same files. Project files are handy if you compare the same files repeatedly.

4.1. Using project files

To use a project file In the WinMerge window, click FileOpen Project. WinMerge reads the paths from the project file. If the project file has two or three paths, two or three paths are opened. If only one path is given or one of the paths is invalid, WinMerge opens the Select Files or Folders dialog, where you can add or correct the path information. Here are a few things to consider:

  • If you specify two project files, the project files themselves are compared.
  • If you specify a project file as the left file but do not specify a right file, the single project file is opened as if you had used the FileOpen Project command.
  • If you specify a project file as the left file and any other file on the right side, the contents of the project file and the other file are compared.

To specify a project file on the command line, simply enter it as a single file path.

4.2. Editing and saving project files

To save a project file, click FileSave Project. The Project File dialog provides fields and options that you can easily edit to build a project file. If a compare window is currently open, the Project File dialog is initialized with values from the current compare; otherwise, you provide the values yourself. To use an existing project, click Open and select a project to load its values (any existing values are overwritten in the dialog).

When you finished editing, click Save to store the file.

Project File dialog

4.3. Project file format

Project files are simple XML files with a .WinMerge extension. For example:

<?xml version='1.0' encoding='UTF-8'?>
      <filter>Visual C++ loose</filter>

A project file contains a paths element that can contain one of each of these elements:


Left path to open


Left description


1 = Open read only

0 = Open normally


Middle path to open


Middle description


1 = Open read only

0 = Open normally


Right path to open


Right description


1 = Open read only

0 = Open normally


File filter name or list of extensions


0 = Subfolders not included

1 = Subfolders included


Unpacker plugin name or plugin pipeline


Prediffer plugin name or plugin pipeline


1 = Text compare window

2 = Table compare window

3 = Binary compare window

4 = Image compare window

5 = Webpage compare window


Delimiter for table editing


0 = Compare whitespaces

1 = Ignore whitespace changes

2 = Ignore all whitespaces


0 = Do not ignore blank lines

1 = Ignore blank lines


0 = Do not ignore case

1 = Ignore case


0 = Do not ignore carriage return differences

1 = Ignore carriage return differences


0 = Do not ignore numbers

1 = Ignore numbers


0 = Do not ignore codepage differences

1 = Ignore codepage differences


0 = Do not ignore comment differences

1 = Ignore comment differences


0 = Full Contents

1 = Quick Contents

2 = Binary Contents

3 = Modified Date

4 = Modified Date and Size

5 = Size

None of the fields is required, and they can be empty (for example, <left></left> or <left/>).