My favorite file comparison tool was Beyond Compare but since I recently switched to OS X, i'm no longer able to use it and I'm looking for an alternative, preferably a free one.

Update: I made the mistake not to specify that I am also looking for a tool that does directory comparison, not only files. Because this could make the already answers invalid I made another question for this What directory comparison tools can I use on OS X?

I tried meld via Macports and a huge number of dependencies were required. I have since shifted to using TextWrangler's diff. This does directory comparisons and you can merge changes line by line. It doesn't do three way compare though.
–
Jason SDec 1 '13 at 6:25

P4Merge is free, very nice, can be used as both a diff and merge too, doesn't need to be downloaded with a perforce client anymore, and can even visually diff images! Download here
–
Brad ParksDec 9 '14 at 14:51

To find FileMerge (assuming you have XCode) ...start up Xcode and choose 'Xcode' menu -> Open Developer Tool -> FileMerge. Or you can avoid starting up XCode by poking around in /Applications/Xcode.app/Contents/Applications/FileMerge.app
–
Harry WoodNov 29 '13 at 13:28

1

When Harry Wood says "poking around" he means typing in the terminal: open /Applications/Xcode.app/Contents/Applications/FileMerge.app
–
RobertoApr 14 '14 at 19:43

There are a great many comparison tools available. Many do directories and files. Some even perform as merge tools (2 and 3 way). Of these some have already been mentioned in other answers and your choice will depend on what features you require, and how much you are prepared to pay for the tool. There is a good Wikipedia page with a comparison of many of the better known ones.