Toolman

ASCII code for newline

10

Line Feed — a control character, not printable

Decimal10
Hexadecimal0x0A
Octal0012
Binary00001010
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

Every character by name · The ASCII table · Text to binary converter