ASCII code for carriage return
13
Carriage Return — a control character, not printable
| Decimal | 13 |
| Hexadecimal | 0x0D |
| Octal | 0015 |
| Binary | 00001101 |
| HTML entity | |
| String escape | \r |
What it is
Returned the print head to the start of the line without advancing the paper. Windows line endings are CR followed by LF because a teletype needed both movements. A lone CR is what lets a progress bar overwrite itself.
The full entry
ASCII 13 in full — the code point page, with what sits either side of it and how the character is encoded elsewhere.
Frequently asked questions
What is the ASCII code for carriage return?
The ASCII code for carriage return is 13 in decimal, 0x0D in hexadecimal and 0015 in octal.
What is carriage return in binary?
00001101 — eight bits, though ASCII only defines seven, so the top bit is always zero.
How do I write carriage return in a string?
Most languages accept the escape \r. Writing the raw character instead works in some contexts and breaks in others, which is what the escape exists to avoid.
Other characters
- ASCII code for shift out — 14
- ASCII code for shift in — 15
- ASCII code for data link escape — 16
- ASCII code for device control 1 (xon) — 17
- ASCII code for device control 2 — 18
- ASCII code for device control 3 (xoff) — 19
- ASCII code for device control 4 — 20
- ASCII code for negative acknowledge — 21
- ASCII code for synchronous idle — 22
- ASCII code for end of transmission block — 23
- ASCII code for cancel — 24
- ASCII code for end of medium — 25
Every character by name · The ASCII table · Text to binary converter