What does Visual Studio mean by normalize inconsistent line endings?

Some lines end with \n.

Some other lines end with \r\n.

Visual Studio suggests you to make all lines end the same.


What that usually means is that you have lines ending with something other than a carriage return/line feed pair. It often happens when you copy and paste from a web page into the code editor.

Normalizing the line endings is just making sure that all of the line ending characters are consistent. It prevents one line from ending in \r\n and another ending with \r or \n; the first is the Windows line end pair, while the others are typically used for Mac or Linux files.

Since you're developing in Visual Studio, you'll obviously want to choose "Windows" from the drop down. :-)


If you are using Visual Studio 2012:

Go to menu FileAdvanced Save Options → select Line endings type as Windows (CR LF).


To turn the option ON/OFF, follow the steps below from menu bar:

ToolsOptionsEnvironmentDocumentsCheck for consistent line endings on load