²

ASCII Character: Superscript two

ASCII Code 178 · Unicode U+00B2 · Hex 0xB2

superscript-two squared

About the Superscript two Character

ASCII code 178 (0xB2) represents the Superscript two character in the extended ASCII table (128–255). It is part of the extended ASCII character set defined by the Windows-1252 (CP-1252) encoding. The extended ASCII range builds upon the original 128-character ASCII set, adding accented letters, currency symbols, typographic marks, and mathematical symbols. These characters are defined by the Windows-1252 (CP-1252) encoding, which is a superset of ISO 8859-1 (Latin-1). In modern web development, UTF-8 encoding is preferred, but understanding extended ASCII remains important for legacy system compatibility and character encoding troubleshooting.

Encoding Details

ASCII Code 178
Hexadecimal 0xB2
Octal 262
Binary 10110010
Unicode U+00B2
Unicode Name SUPERSCRIPT TWO
HTML Numeric ²
HTML Entity ²
URL Escape %B2
UTF-8 (Hex) C2 B2
Quoted-Printable =B2

Source Code Examples

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

Navigate

Copied!