Home

0xB

0xB is the hexadecimal literal representing the decimal value 11. The prefix 0x is commonly used in programming to denote that the following digits are in base 16, where the digits 0–9 represent values zero through nine and the letters A–F (often written upper or lower case) represent values ten through fifteen. In this system, B represents the value eleven.

In binary terms, 0xB corresponds to 1011. In an 8-bit byte, this value is often written as

Programming usage and contexts: 0xB is a common form for numeric literals in many languages, including C,

Limitations and clarifications: while 0xB is a valid literal, its interpretation depends on the language and

0x0B
to
emphasize
the
full
byte
width,
though
many
languages
treat
0xB
the
same
as
0x0B.
The
relationship
among
representations
is:
decimal
11
equals
hex
0xB,
which
equals
binary
1011.
C++,
Java,
JavaScript,
and
Python.
It
is
frequently
used
in
low-level
tasks
such
as
bitwise
operations,
bit
masks,
flag
fields,
and
index
calculations.
Because
hex
digits
align
neatly
with
four-bit
groups
(nibbles),
hexadecimal
notation
is
convenient
for
expressing
binary
patterns
and
memory-related
values.
context,
but
it
generally
represents
the
integer
value
eleven.
Hexadecimal
literals
are
separate
from
decimal
literals
and
from
other
base
notations;
they
should
be
distinguished
when
parsing
or
converting
values
in
software
systems.
In
color
codes
or
larger
numeric
constants,
0xB
may
appear
as
part
of
a
longer
hexadecimal
sequence
rather
than
as
a
stand-alone
value.