STX

ASCII Code 2

Start of Text

About This Character

ASCII code 2 (0x02) represents the Start of Text (STX) control character. This is a non-printable character defined in the original ASCII standard (1963). It belongs to the communication control group, used in data transmission protocols to manage the flow of information between devices. Control characters occupy codes 0–31 and 127 in the ASCII table and were originally designed for controlling hardware devices, managing communication links, and formatting text output. While many control characters have become obsolete with modern computing, several like LF (Line Feed), CR (Carriage Return), TAB, and ESC remain essential in everyday programming and text processing.

Character Encoding

Decimal 2
Octal 002
Hexadecimal 0x02
Binary 00000010
HTML Code 
HTML Entity
Unicode U+0002
Unicode Name START OF TEXT
URL Escape %02
Quoted-Printable =02
UTF-8 (Hex) 02
Category Control — Communication Control

How to Type in Code

JavaScript
// Using escape sequence
let char = '\x02';
// Using String.fromCharCode
let char2 = String.fromCharCode(2);
Python
# Using escape sequence
char = '\x02'
# Using chr()
char = chr(2)
HTML
<!-- Using HTML entity -->
&#2;
C#
// Using escape sequence
char c = '\x02';
// Using cast
char c2 = (char)2;

See Also

Copied!