*

ASCII Character: Asterisk

ASCII Code 42 · Unicode U+002A · Hex 0x2A

asterisk star

About the Asterisk Character

ASCII code 42 (0x2A) represents the Asterisk character "*". The "Asterisk" character (*) with ASCII code 42 is a mathematical operator. Mathematical operators in the printable ASCII range provide the fundamental arithmetic symbols used in programming, spreadsheets, and mathematical notation. The printable ASCII characters (codes 32–126) include the space, digits, uppercase and lowercase Latin letters, and common punctuation symbols. These 95 characters form the foundation of text representation in virtually all computing systems and are universally supported across all character encodings, programming languages, and operating systems.

Encoding Details

ASCII Code 42
Hexadecimal 0x2A
Octal 052
Binary 00101010
Unicode U+002A
Unicode Name ASTERISK
HTML Numeric *
HTML Entity *
URL Escape %2A
UTF-8 (Hex) 2A
Quoted-Printable *

Source Code Examples

JavaScript
// Character literal
let char = '*';
// Using char code
let char2 = String.fromCharCode(42);
// Unicode escape
let char3 = '\x2A';
Python
# Character literal
char = '*'
# Using chr()
char = chr(42)
# Using ord() to get code
code = ord('*')  # Returns 42
HTML
<!-- Direct character -->
*
<!-- HTML entity (numeric) -->
&#42;
<!-- Hex entity -->
&#x2A;
C#
// Character literal
char c = '*';
// Using cast
char c2 = (char)42;
// To get code from char
int code = (int)'*';  // Returns 42

Navigate

Copied!