DevKits

ASCII 66

Latin Capital Letter B (B)

Printable ASCII

Uppercase letter B. ASCII code 66. Lowercase 'b' is code 98 (add 32). The uppercase block A-Z spans 65-90, contiguous, so isUpper is just c >= 'A' && c <= 'Z'.

Common uses & context

Theuppercase letter 'B' has ASCII code 66 (0x42). Its lowercase twin 'b' sits exactly 32 code points away at 98. That constant gap of 32 — a single bit, 0x20 — is why changing letter case is one of the cheapest operations a CPU can do: you flip or mask one bit rather than looking anything up. Uppercase letter B. ASCII code 66. Lowercase 'b' is code 98 (add 32). The uppercase block A-Z spans 65-90, contiguous, so isUpper is just c >= 'A' && c <= 'Z'.

The uppercase Latin letters form the contiguous block 65–90, so range checks like c >= 'A' && c <= 'Z' work without a lookup table. To convert 'B' to its lowercase form youset bit 5: 'B' | 0x20 gives 'b'. Because uppercase (65–90) sorts before lowercase (97–122) in raw byte order, naive sorting places every capitalized wordahead of every lowercase one — the reason "Zebra" comes before "apple" unless you sort case-insensitively.

'B' is also a hexadecimal digit: in base-16 it represents the value 11. Hex uses 0–9 for 0–15's firstten values and A–F (or a–f) for 10–15, so 'B' is valid inside literals like 0xBB and colour codes like #BBBBBB.

All encodings at a glance

Decimal66
Hexadecimal0x42
Octal0102
Binary01000010
HTML numeric entity&#66;
URL encoding%42
UTF-8 bytes0x42

Code snippets

JavaScript

String.fromCharCode(66); // "B"
66.toString(16); // "42"

Python

chr(66)           # 'B'
ord(chr(66))      # 66
hex(66)           # '0x42'

HTML

&#66;   <!-- numeric entity (no named entity for this character) -->

Programming notes

  • Case toggle: 'B' | 0x20 = 'b' (a single-bit change).
  • Letter test: c >= 'A' && c <= 'Z' — the uppercase block is contiguous (65–90).
  • As a hex digit, 'B' has value 11 in base-16.

Frequently asked questions

What character is ASCII code 66?

ASCII code 66 is the character 'B' (Latin Capital Letter B). In hexadecimal it is 0x42, in octal 0102, and in binary 01000010.

What is 0x42 in ASCII?

Hexadecimal 0x42 equals decimal 66, which is the character 'B' (Latin Capital Letter B). To convert hex to ASCII yourself, read the two hex digits as a base-16 number (0x42 = 66) and look up that code point.

How do I write the character with code 66 in code?

In JavaScript use String.fromCharCode(66); in Python use chr(66); in HTML use the numeric entity &#66;. In a URL it is percent-encoded as %42, and in UTF-8 it is stored as the byte sequence 0x42.

What is the lowercase form of 'B' in ASCII?

'B' is code 66; its lowercase counterpart 'b' is code 98. The two always differ by 32, so you can convert by adding 32 (or setting bit 0x20).

Nearby codes

Encode & convert this character