ASCII code for newline
10
Line Feed — a control character, not printable
| Decimal | 10 |
| Hexadecimal | 0x0A |
| Octal | 0012 |
| Binary | 00001010 |
| HTML entity | |
| String escape | \n |
What it is
Moved the paper up one line without moving the carriage. Unix and macOS use it alone to end a line; Windows uses CR+LF. This single difference is behind most "the whole file shows as changed" diffs.
The full entry
ASCII 10 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 newline?
The ASCII code for newline is 10 in decimal, 0x0A in hexadecimal and 0012 in octal.
What is newline in binary?
00001010 — eight bits, though ASCII only defines seven, so the top bit is always zero.
How do I write newline in a string?
Most languages accept the escape \n. 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 vertical tab — 11
- ASCII code for form feed — 12
- ASCII code for carriage return — 13
- 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
Every character by name · The ASCII table · Text to binary converter