Helix Core is now P4. Product user interfaces will be updated soon. Learn more >>

P4 Merge Documentation | 2025.4

# Diffing text files

In its diff mode, P4 Merge enables you to compare two text files to locate differences. (P4 Merge can also diff image files.)

The purple icon () is associated with the first file you selected, and purple bands highlight text that is in the first file but not the second file. The green icon () is associated with the second file you selected, and green bands highlight text that is in the second file but not the first file.

By default, P4 Merge displays diffs in a side-by-side layout. However, you may prefer to view changes closer to each other. In this case, you can switch to single-pane layout. To display diffs in a single pane, go to View > Single Pane Diff Layout. In single-pane mode, deleted text is shown using strike-through text.

To toggle the display of line numbers, click .

For information on diffing files from within P4 Visual Client (P4V), see Diffing files in the P4 Visual Client (P4V) Documentation.

To diff files:

1. Go to File > New Merge or Diff.

2. In the Choose Files dialog box, on the Diff tab, specify the two files to be compared.

3. Click OK.

   P4 Merge shows each file in its own pane, with differences highlighted in blue and green, respectively.

Syntax highlighting is available (starting with version 2020.2). Click the Show Syntax Highlighting button to toggle the feature on or off.

More than 300 languages supported languages are listed at https://kate-editor.org/syntax/.

If you are working with large text files, see the Support Knowledgebase article, Improving diff results when comparing files with more than 50,000 lines.

## Navigate diffs

To move forward and back through individual differences, or to locate specific text or lines, click the toolbar buttons listed below.

Go to next diff |
Go to previous diff |
Find text |
Go to line number |

### Edit text

If needed, you can edit files directly in P4 Merge, provided you are viewing them side by side. In Double Pane Diff Layout, for files that are available in the workspace and writable, the edit file buttons become available in the toolbar:

- Select to edit the file in the left pane.
- Select to edit the file in the right pane.

The edit pane opens at the bottom of the window. Make your changes and save the file.

Your search for returned results