Newline Code

Control characters representing line breaks. Three types exist: LF (Unix), CR (old Mac), and CRLF (Windows).

A newline code is a control character that represents a line break in text data. The three main types are LF (Line Feed, U+000A), CR (Carriage Return, U+000D), and CRLF (CR followed by LF).

Unix/Linux/macOS uses LF, Windows uses CRLF, and classic Mac OS used CR. These differences affect file compatibility, and Git's core.autocrlf setting controls automatic conversion. Git practical guides teach newline code management.

In programming, newline code differences can cause bugs. File reading code must handle both and .

The HTTP protocol uses CRLF to separate headers, and the CSV specification (RFC 4180) also standardizes on CRLF. Programming fundamentals books cover text processing basics.