Null character
The null character is a control character with the value zero. Many character sets include a code point for a null character including Unicode (Universal Coded Character Set), ASCII (ISO/IEC 646), Baudot, ITA2 codes, the C0 control code, and EBCDIC. In modern character sets, the null character has a code point value of zero which is generally translated to a single code unit with a zero value. For instance, in UTF-8, it is a single, zero byte. Originally, its meaning was like NOP when sent to a printer or a terminal, it had no effect (although some terminals incorrectly displayed it as space). When electromechanical teleprinters were used as computer output devices, one or more null characters were sent at the end of each printed line to allow time for the mechanism to return to the first printing position on the next line. On punched tape, the character is represented with no holes at all, so a new unpunched tape is initially filled with null characters, and often text could be...
The null character is a control character with the value zero. Many character sets include a code point for a null character including Unicode (Universal Coded Character Set), ASCII (ISO/IEC 646), Baudot, ITA2 codes, the C0 control code, and EBCDIC. In modern character sets, the null character has a code point value of zero which is generally translated to a single code unit with a zero value. For instance, in UTF-8, it is a single, zero byte. Originally, its meaning was like NOP when sent to a printer or a terminal, it had no effect (although some terminals incorrectly displayed it as space). When electromechanical teleprinters were used as computer output devices, one or more null characters were sent at the end of each printed line to allow time for the mechanism to return to the first printing position on the next line. On punched tape, the character is represented with no holes at all, so a new unpunched tape is initially filled with null characters, and often text could be inserted at a reserved space of null characters by punching the new characters into the tape over the nulls. A null-terminated string is a commonly used data structure in the C programming language, its many derivative languages and other programming contexts that uses a null character to indicate the end of a string. This design allows a string to be any length at the cost of only one extra character of memory. The common competing design for a string stores the length of the string as an integer data type, but this limits the size of the string to the range of the integer (for example, 255 for a byte). For byte storage, the null character can be called a null byte. ==External links== Null Byte Injection WASC Threat Classification Null Byte Attack section Poison Null Byte Introduction Introduction to Null Byte Attack Apple null byte injection QR code vulnerability
References
- ^ ASCII format for Network Interchange . IETF . sec. 5.2. doi : 10.17487/RFC0020 . RFC 20 . NUL (Null): The all-zeros character which may serve to accomplish time fill and media fill. Wikipedia revision 1361774466, retrieved 2026-11-18 · 1794956400.0
- ^ Null Byte Injection WASC Threat Classification Null Byte Attack section. Wikipedia revision 1361774466, retrieved 2026-11-18 · 1794956400.0
- ^ "The set of control characters of the ISO 646" (PDF) . Secretariat ISO/TC 97/SC 2. 1975-12-01. p. 4.4. Archived from the original (PDF) on 2014-05-12. Position: 0/0, Name: Null, Abbreviation: Nul Wikipedia revision 1361774466, retrieved 2026-11-18 · 1794956400.0
- ^ "Unicode Character 'NULL' (U+0000)" . Retrieved 2018-10-20 . Wikipedia revision 1361774466, retrieved 2026-11-18 · 1539990000.0
- ^ "C0 Controls and Basic Latin" (PDF) . Unicode Consortium. 2018 . Retrieved 2018-10-20 . Wikipedia revision 1361774466, retrieved 2026-11-18 · 1539990000.0
- ^ "A byte with all bits set to 0, called the null character , shall exist in the basic execution character set; it is used to terminate a character string literal." — ANSI/ISO 9899:1990 (the ANSI C standard), section 5.2.1 Wikipedia revision 1361774466, retrieved 2026-11-18 · 1794956400.0
- ^ "A string is a contiguous sequence of characters terminated by and including the first null character" — ANSI/ISO 9899:1990 (the ANSI C standard), section 7.1.1 Wikipedia revision 1361774466, retrieved 2026-11-18 · 1794956400.0
- ^ "17.5.2.1.4.1 Byte strings", Working Draft, Standard for Programming Language C++ (PDF) (ISO 14882 standard working draft), ISO / IEC , 28 February 2011, p. 427, N3242=11-0012 , retrieved 29 June 2026 , A null-terminated byte string , or NTBS, is a character sequence whose highest-addressed element with defined content has the value zero (the terminating null character); no other element in the sequence has the value zero. Wikipedia revision 1361774466, retrieved 2026-11-18 · 1794956400.0
- ^ In YAML this combination is a separate escape sequence . Wikipedia revision 1361774466, retrieved 2026-11-18 · 1794956400.0
- ^ Kernighan and Ritchie, C , p. 38: "The character constant '\0' represents the character with value zero, the null character. '\0' is often written instead of 0 to emphasize the character nature of some expression, but the numeric value is just 0." Wikipedia revision 1361774466, retrieved 2026-11-18 · 1794956400.0
Cite this
"Null character". 1782772993. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1361774466 JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy