Home

uint8

uint8 is an unsigned integer type that uses 8 bits of memory, capable of representing integers in the range 0 to 255 inclusive. It is commonly described as a single byte, and its storage size is fixed at one byte across most platforms and languages.

Because it is a single byte, endianness does not affect its representation. Endianness matters for multi-byte

In programming languages, the type is implemented under different names. In C and C++, the type is

Arithmetic with uint8 values is typically modulo 256, meaning additions or multiplications that exceed 255 wrap

Common applications include binary I/O, network protocol implementations, image processing (color channels such as red, green,

values,
but
a
uint8
value
is
identical
in
memory
regardless
of
the
system’s
byte
order.
uint8_t
and
is
defined
in
stdint.h.
In
Rust,
the
equivalent
is
u8;
in
Go
and
C#,
the
type
is
uint8.
Some
languages
use
alternate
naming
conventions
or
provide
similar
types
as
part
of
their
standard
libraries.
In
JavaScript,
there
is
no
native
uint8
primitive;
instead,
the
Uint8Array
typed
array
stores
0–255
values
in
a
contiguous
buffer
for
binary
data.
around
(for
languages
with
wrapping
unsigned
arithmetic).
Conversions
from
larger
integer
types
may
truncate
to
the
lower
8
bits.
This
makes
uint8
well-suited
for
raw
binary
data,
where
each
value
represents
a
byte,
and
for
encoding
schemes
where
bytes
must
remain
within
0–255.
and
blue),
and
storage
of
small
numeric
values
in
compact
buffers
or
arrays.
In
text
data,
values
0–127
correspond
to
ASCII
characters,
while
128–255
may
represent
extended
character
sets
depending
on
encoding.