Search⌘ K
AI Features

Binaries

Explore how Elixir handles binaries as sequences of bits, use binary literals and size modifiers, and apply pattern matching to extract and manipulate data like integers, floats, and custom binary structures.

We'll cover the following...

Binaries

The binary type represents a sequence of bits. A binary literal looks like << term,... >>. The simplest term is just a number from 0 to 255. The numbers are stored as successive bytes in the binary.

iex> b = << 1, 2, 3 >> 
<<1, 2, 3>>

iex>
...