Max value of n-bits ADC
There is a simple relationship between the voltages and digital values involved in a ADC:
$$\frac{V_{IN}}{V_{REF}} = \frac{DigitalOutput}{2^N}$$
where \$N\$ is the number of bits.
If \$V_{IN} = 0\$ you would certainly expect the digital output to be integer 0.
The step size (voltage equivalent of a change in LSB) is
$$V_{LSB} = \frac{1}{2^N} \times V_{REF}$$
So the voltage that will produce the largest digital output value is
$$V_{MAX} = \frac{2^N-1}{2^N} \times V_{REF}$$
So, for a 10-bit ADC with a reference voltage of \$3.3\,\text{V}\$, the integer output value of 1023 (0x3FF) corresponds to a voltage of approximately \$3.297\,\text{V}\$. Any voltage above this value will also give a digital output of 1023.
There is one additional wrinkle. Some ADCs will offset the switching thresholds by \$\frac{1}{2}V_{LSB}\$ to reduce the quantization error. These ADCs have slightly different behavior; check the datasheet for details.