Skip to content
ASCII World
STX

Start of Text

ControlASCII 2 | Hex 0x02 | U+0002
STX (code 2) signals the start of message body content, immediately following any header information introduced by SOH. In point-of-sale terminals and legacy banking protocols, STX and ETX still frame transaction data. The pattern is simple: SOH, then header bytes, then STX, then payload, then ETX. This framing scheme predates modern packet-based networking but remains embedded in hardware protocols for ATMs, card readers, and industrial sensors that predate TCP/IP adoption.

ASCII Code

Decimal
2
Hexadecimal
0x02
Octal
2
Binary
0000 0010

Unicode

Code Point
U+0002
Escape
\u0002
UTF-8 Hex
0xE2 0x90 0x82
UTF-8 Binary
111000101001000010000010
UTF-16
0x0002
UTF-32
0x00000002

HTML Entities

Numeric

Hex


How to Type

HTML Entity

Unicode InputU+0002

Source Code Representations

C / Java
"\u0002"
CSS
\0002
JavaScript
"\u0002"
Perl
\x{0002}
Python 2
u"\u0002"
Python 3
\u0002
Ruby
\u{0002}

Frequently Asked Questions

What is ASCII code 2?
ASCII code 2 represents the Start of Text character. In hexadecimal it is 0x02, in binary 0000 0010, and in octal 2. This is a non-printable control character used for device signaling and data transmission control.
How do I type ASCII 2 on a keyboard?
Control characters are typically entered using Ctrl key combinations. For example, Ctrl+B produces ASCII 2 in most terminal emulators. You can also use the HTML entity  in web pages.