I'm not sure if this is the most elegant modelling way. However, this is exactly how integer numbers are represented in the computer:
Let's consider one integer variable $x \in \mathbb{Z}$ with $L \leq x \leq U$
and $L \geq 0$, i.e. $x$ is not negative.
By introducing $M$ binary variables (bits) $b_0, \ldots, b_{M-1}$,
we have the representation of $x$ in the base 2 which reads as:
$$
x = (b_{M-1}b_{M-2}\ldots b_{0})_2 = \sum_{j=0}^{M-1} b_j \cdot 2^j.
$$
In order to use as few binary variables (bits) as possible, we need the smallest $M$ such that
$$
U \leq \max \sum_{j=0}^{M-1} b_j \cdot 2^j %
= \sum_{j=0}^{M-1} 1 \cdot 2^j %
= 2^{M} - 1,
$$
which yields $M = \left\lceil \log_2{(U + 1)} \right\rceil $.
In case $x$ is not guaranteed to be positive, one can use
the two complement representation:
$$
x = (b_{M-1}b_{M-2}\ldots b_{0})_2 = -b_{M-1} \cdot 2^{M-1} + \sum_{j=0}^{M-2} b_j \cdot 2^j,
$$
where $M = \left \lceil \log_2{( \max \{ |L|, |U| \} + 1)} + 1\right \rceil$ is the minimal number of binary variables required to represent $x$.