-

ASCII Character: Hyphen-minus

ASCII Code 45 · Unicode U+002D · Hex 0x2D

hyphen-minus hyphen dash minus

About the Hyphen-minus Character

ASCII code 45 (0x2D) represents the Hyphen-minus character "-". The "Hyphen-minus" character (-) with ASCII code 45 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 45
Hexadecimal 0x2D
Octal 055
Binary 00101101
Unicode U+002D
Unicode Name HYPHEN-MINUS
HTML Numeric -
HTML Entity
URL Escape %2D
UTF-8 (Hex) 2D
Quoted-Printable -

Source Code Examples

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

Navigate

Copied!