Looking for a diff tool (preferably with GUI, for Windows, and free, but others are welcome too) that can ignore newlines, so diffs that are only lines joined or broken are ignored. It should also have the option to ignore other "white space only" changes.

For example:

void foo(){
    int a=1+2;

void foo()
    int a = 1 + 2;

These two should compare as "no changes".

(the above is just an example, it should handle all/most textual file types, not just C)

  • When it comes to source code I would suggest to apply a source code formatter onto both code files/directories so that formatting changes are ignored.
    – Robert
    Sep 16, 2021 at 9:53
  • That would work in some cases, but I'm looking for a tool to compare unchanged input files. Sep 16, 2021 at 10:49
  • See also askubuntu.com/questions/1073349/…
    – Robert
    Sep 16, 2021 at 11:06

1 Answer 1


IntelliJ IDEA * has a builtin file compare with several options. One of them is "Ignore whitespaces and empty lines" which does what is asked for.

* currently at version 2021.2.2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.