---
aliases: [binary, binary representation, base 2, base 2 representation]
---
#computer-arithmetic
## Definition
> [!tldr] Definition
> An [[Integers|integer]] is written in **base 2** or **binary** format if it consists of a string of the numbers $0$ and $1$, called **[[Binary digits and bitstrings|binary digits]]** or "**[[Binary digits and bitstrings|bits]]**", that represent groupings of powers of 2.
Notes:
- A group of 8 bits is known as a **byte**.
- Every positive integer can in fact be written as a sum of powers of 2 and in only one way. This fact can be proven using [[Mathematical induction|mathematical induction]].
## Examples
The number $267$ can be written as a sum of powers of $2$ as follows:
$267 = 256 + 8 + 2 + 1 = 2^8 + 2^3 + 2^1 + 2^0$
Using $0$ to pad this sum with groups that are not used and $1$ multiplied to groups that are use, this becomes:
$267 = 256 + 8 + 2 + 1 = 1 \cdot 2^8 + 0 \cdot 2^7 + 0 \cdot 2^6 + 0 \cdot 2^5 + 0 \cdot 2^4 + 1 \cdot 2^3 + + 0 \cdot 2^2 + 1 \cdot 2^1 + 1 \cdot 2^0$
The resulting string of $0