Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Can some one tell me what these 2 formats CRLF and LF are and where they are used?
Thanks in advance!

I'm not sure what you are asking but CRLF generally means Carriage Return Line Feed (hex codes 0D and 0A)and are normally used at the end of a line.
CRLF moves the input/output to the leftmost position on the next line.

[edit - beaten to the punch]
They both indicate where new lines start, the are used so text files aren't displayed as one long line.
I'm not sure why there are two formats, but CRLF is generally DOS\Windows and LF is generally Unix\Linux.
CR stands for "carriage return" and LF stands for "line feed". According to a post I read here by M2 the terminology comes from typewriters. Carriage return brings the barrel back to the beginning of the line and line feed goes down to the next line.
CR and LF are represented by the hex bytes 0D and 0A respectively.
It seems to me the Dos people may have said "we don't just want a new line, we want it at the beginning of the new line". The Unix people may have said "why waste a byte that does nothing?". Of course this is just pure speculation with absolutely no research, just a rationalisation of a trivial incompatibility.

To add further confusion. There is a third method carriage return only (CR) used in early Mac's. Remember these were originally based on hardcopy character devices (the typewriter).

There is a rumour that the Unix people decided to save a byte by shortening CR LF to a single character; they didn't choose CR because that's 13 decimal, which is unlucky.

Some years back (during the DOS era) the users had to input many printer commands, into what may be described as printer drivers for word processing software, by themselves. Many of the dot matrix printers that were used couldn't print bidirectional, so the CR command was used without the LF, to send the printhead back to the beginning of the current line, for a second pass, to provide bold writing or NLQ (Near Letter Quality).
Nigel
This is just a sig

![]() |
Show hardware list using ...
|
hide link in network driv...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |