N
The Daily Insight

Which line endings does Linux use?

Author

Isabella Ramos

Updated on February 25, 2026

Back to line endings The reasons don’t matter: Windows chose the CR/LF model, while Linux uses the \n model. So, when you create a file on one system and use it on the other, hilarity ensues.

What line endings does Windows use?

On Windows, line-endings are terminated with a combination of a carriage return (ASCII 0x0d or \r) and a newline(\n), also referred to as CR/LF. On the Mac Classic (Mac systems using any system prior to Mac OS X), line-endings are terminated with a single carriage return (\r or CR). (Mac OS X uses the UNIX convention.)

Is Windows CRLF or LF?

All versions of Microsoft Windows represent line endings as CR followed by LF. UNIX and UNIX-like operating systems (including Mac OS X) represent line endings as LF alone.

Does Mac use LF or CRLF?

The Mac, by default, uses a single carriage return ( ), represented as \r . Unix, on the other hand, uses a single linefeed ( ), \n . Windows goes one step further and uses both, creating a ( ) combination, \r\n .

What is the difference between line feed and carriage return?

A line feed means moving one line forward. The code is \n . A carriage return means moving the cursor to the beginning of the line.

Is Linux similar to Windows?

When it comes to operating systems there are two main systems used for the PC, Linux and Microsoft Windows. They are both similar as they are different. Linux and Windows are both operating systems which are interfaces that are responsible for the activities and sharing of the computer.

What is a line ending?

Newline (frequently called line ending, end of line (EOL), line feed, or line break) is a control character or sequence of control characters in a character encoding specification (e.g. ASCII or EBCDIC ) that is used to signify the end of a line of text and the start of a new one. Text editors set this special character when pressing the Enter key.