Search code examples
windowscarriage-returnline-endingslinefeed

Why does Windows use CR LF?


I understand the difference between the two so there's no need to go into that, but I'm just wondering what the reasoning is behind why Windows uses both CR and LF to indicate a line break. It seems like the Linux method (just using LF) makes a lot more sense, saves space, and is easier to parse.


Solution

  • Historically when using dot-matrix printers teletypes CR would return the carriage to the first position of the line while LF would feed to the next line. Using CR+LF in the file themselves made it possible to send a file directly to the printer, without any kind of printer driver.

    Thanks @zaph pointing out it was teletypes and not dot matrix printers