Toolman

ASCII code for null character

0

Null — a control character, not printable

Decimal0
Hexadecimal0x00
Octal0000
Binary00000000
HTML entity�
String escape\0

What it is

Represents nothing at all. C uses it to mark the end of a string, which is why a C string cannot contain one and why "null-terminated" is a phrase at all. Writing a NUL into text that later reaches C code is a classic source of silent truncation.

The full entry

ASCII 0 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 null character?

The ASCII code for null character is 0 in decimal, 0x00 in hexadecimal and 0000 in octal.

What is null character in binary?

00000000 — eight bits, though ASCII only defines seven, so the top bit is always zero.

How do I write null character in a string?

Most languages accept the escape \0. 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