Category: 

What Is Carriage Return?

Typewriters once relied on carriage returns to advance pages.
A computer's "enter" key performs the same function as a carriage return.
Article Details
  • Written By: Cathy Rogers
  • Edited By: Niki Foster
  • Last Modified Date: 15 April 2014
  • Copyright Protected:
    2003-2014
    Conjecture Corporation
  • Print this Article
Free Widgets for your Site/Blog
Annual microwave sales in the US are down about 40% since 2004.  more...

April 20 ,  1864 :  Louis Pasteur performed his first pasteurization tests.  more...

In pre-computer days, typewriters were equipped with a lever on the left-hand side known as a carriage return. When pressed, the mechanism sent the paper-holding cylinder, or carriage, to the right, and at the same time, rotated the paper upward to begin a new line. Eventually, a power return was created that was pressed with the little finger on the right hand. This feature was first added to electric typewrites in 1960 by Smith Corona.

The carriage return, or just “return” for short, is now known as the enter key and is labeled with a backward arrow symbol (↵). This key serves the same function as the original lever, moving the cursor to the beginning of the next line. With the advent of word wrap, however, it was no longer necessary to press return at the end of each line. Now, the enter/return key is known as a hard return and is used only at the end of a paragraph.

Carriage return also refers to the symbol, command, or key that causes the printer to be positioned, or the cursor to be displayed, at the left margin. It also controls paper feeding. In ASCII or Unicode, the character code decimal 13 represents it. In some programming languages, such as C, UNIX, Java and others, it is signified by \r.

Ad

Because of variances in operating languages and the codes they use, text files are not always compatible between operating systems. For example, Macintosh uses the code CR to indicate the end of each line, similar to the typewriter. With Linux, each line ends with LF, which indicates line feed. These codes not only differ in lettering; their ASCII codes are different as well — CR is a 13 in ASCII code and LR is a 10. With Microsoft products, lines end with a combination of both: CRLF.

Fortunately, most people can use File Transfer Protocol (FTP) to transfer text files from one operating system to another. To transfer text files, users should choose the ASCII mode of FTP. To transfer other types of files, such as photos or sound files, they should use FTP in the binary mode.

Ad

Discuss this Article

anon114904
Post 3

"Cr is a 13 in ascii code and lr is a 10"

lr -> lf

willie3
Post 2

@GoldenRatio - Good question! There are many situations where you will not be able to input a carriage return with the enter key because pressing the enter key will result in another action.

In windows, to enter a carriage return using ASCII, hold down the ALT key and hit the key sequence ‘0’ ‘1’ ‘3.’ When you release the alt key, a carriage return will be inserted.

I’m *pretty* sure it works the same way on OSX and linux.

GoldenRatio
Post 1

Good article. This article mentions the ASCII code for a carriage return… can anybody tell me how I would input a carriage return by using the ASCII code and not the enter key?

Post your comments

Post Anonymously

Login

username
password
forgot password?

Register

username
password
confirm
email