Home

0xFFFFFFFF

0xFFFFFFFF is a hexadecimal literal that encodes a 32-bit value with all bits set to one. In binary it is 11111111 11111111 11111111 11111111, a pattern commonly used to represent the concept of all bits active in 32-bit contexts.

In unsigned 32-bit form, 0xFFFFFFFF equals 4294967295. In signed 32-bit two's-complement form, the same bit pattern

Common uses include as a bitmask that preserves all 32 bits when applied with bitwise operations; as

Practical considerations include endianness, which affects in-memory byte order but not the logical value 0xFFFFFFFF; printing

represents
-1.
Because
of
two's
complement,
-1
and
all-ones
patterns
coincide
in
32-bit
systems.
When
used
in
languages
with
wider
or
arbitrary-precision
integers,
the
interpretation
depends
on
the
target
width
and
type.
a
sentinel
value
indicating
an
error,
not-found,
or
overflow
in
APIs
that
return
a
32-bit
quantity.
In
networking,
0xFFFFFFFF
corresponds
to
the
IPv4
broadcast
address
255.255.255.255.
This
pattern
is
also
encountered
in
various
protocols
and
low-level
interfaces
as
a
conventional
all-ones
value.
or
formatting
may
show
-1
if
interpreted
as
a
signed
type.
Always
consider
the
intended
type
(signed
vs
unsigned)
when
comparing
against
0xFFFFFFFF
in
code.