Make FileMerge diff .plist files

In doing macintosh program development I had often come across the case where I wanted to view the difference between two .plist files. Specifically when you are doing diffs of say your UserDefaults.plist in your application you are developing in XCode say…

Previously .plist files were all stored as ASCII files but in OSX 10.4 Apple started compressing them. If you attempt to diff one of these compressed .plist files in FileMerge it complains that the files are binary and should it proceed anyway. If you do proceed you get a comparison between garbage and garbage and you can’t see any of your changes to verify that you made the right changes in Xcode.

Anyway I had googled for a solution but didn’t find one easily. But recently this annoyed me enough that I overcame the thresh-hold of annoyance and looked for a solution. (likely you are reading this post for the same reason!) So it turns out that its pretty easy to get FileMerge to nicely display diffs of .plist files.

You need to add a simple filter to FileMerge. You can do this by hand.

  1. Open File Merge
  2. Go to Preferences -> Filters
  3. After the last item in the list of filters double click to enter new values and enter without the quote characters
  4. ‘plist’ in the extension column.
  5. ‘/usr/bin/plutil -convert xml1 -o –  $(FILE)’ in the Filter column.
  6. ‘Filtered’ in the Display column.
  7. ‘No’ in the Apply* column

Thats it. It should look like something like (I have a few other filters in there as well):

Picture of final FileMerge preferences

FileMerge Preferences

Or if you are more macho about such things, execute the following in the terminal:

defaults write Filters -array-add '{ Apply = 0; Display = 0; Extension = plist; Filter = "/usr/bin/plutil -convert xml1 -o -  \$(FILE)"; }'

Thats it. Go do some diffing!


  1. Luke Said,

    June 5, 2011 @ 9:16 am

    This doesn’t work for me in Filemerge 2.5. I select the files to diff, hit compare, the dialog closes but the diff screen never appears.

  2. jason Said,

    December 20, 2011 @ 10:59 pm

    Uhhh… Well it is still working for me and still working in FIleMerge 2.5 (build 1633.0). In fact I just found out about /usr/bin/textutil which can be used to convert doc, docx, and some other formats to text. I’ll post another blog update shortly about this.

  3. Mark Said,

    October 22, 2012 @ 6:31 am

    In Step 5, the dash characters should both be dash and not em-dash or whatever the web browser is converting them too. When in doubt, edit the string in an editor which supports ascii only characters and make sure that every character is ascii. 😉

  4. dmitry Said,

    June 26, 2013 @ 4:52 pm

    You rock! It is working in Filemerge 2.7.2 (2502)

Leave a Comment