ADC Resolution Calculator: LSB, Code to Voltage, SNR and ENOB
By FindMySum · Last reviewed
Every analog-to-digital converter chops its input range into a fixed number of steps. How big each step is, which code a voltage becomes, how much noise the chopping adds and how fast you must sample are the first questions in any measurement design. This ADC resolution calculator answers them for any bit depth and input range, and it works backwards for a DAC or for reading a code back as a voltage.
LSB size
An n-bit converter has 2ⁿ codes, from 0 to 2ⁿ − 1. The size of one step, the least significant bit (LSB), is
LSB = (Vhigh − Vlow) ÷ 2ⁿ
The calculator opens with a 12-bit converter on a 0 to 3.3 V range, the set-up of many microcontrollers. It has 4,096 codes and an LSB of 3.3 ÷ 4,096 = 805.7 µV, which is 0.024% of the range.
Two conventions
Most ADC datasheets divide by 2ⁿ. The code changes at every whole LSB, and the top code, 4,095, stands for 3.2992 V; the reference itself is one LSB above the highest code. Some DAC datasheets and microcontroller examples divide by 2ⁿ − 1 instead, so that the top code lands exactly on the reference. The difference is one part in 2ⁿ, small at 12 bits but noticeable at 8. Check the transfer function in your converter's datasheet and pick the matching option; the calculator labels both.
Voltage to code and code to voltage
With truncating codes, the code for a voltage V is
code = floor((V − Vlow) ÷ LSB)
and 1.65 V on the default converter is exactly 2,048 LSB, so it reads as code 2,048 (0x800 in hexadecimal). Many converters add a half-LSB offset so that codes change halfway between steps, which rounds instead of truncating; the calculator offers that too. A voltage outside the range clips to code 0 or the top code.
Going the other way, a code stands for Vlow + code × LSB. This is what a DAC outputs, and what you calculate when converting an ADC reading back to volts.
Quantisation error and noise
The difference between the input and the voltage its code stands for is the quantisation error. With truncation it runs from 0 to 1 LSB, with rounding from −½ to +½ LSB. For a signal that moves across many codes the error behaves like random noise with an rms value of
LSB ÷ √12
which is 232.6 µV for the default converter.
Ideal signal-to-noise ratio
Compare a full-scale sine wave with that noise and you get the famous formula from Analog Devices' tutorial MT-001:
SNR = 6.02n + 1.76 dB
Each extra bit halves the step size and adds 6.02 dB. The 1.76 dB comes from the ratio of a sine wave's rms value to its peak. A 12-bit converter can reach 74.0 dB, a 16-bit one 98.1 dB and a 24-bit one 146.3 dB, though no real 24-bit converter gets close to that.
Effective number of bits
Real converters add thermal noise, distortion and clock jitter to the quantisation noise. Datasheets report the result as SINAD, the signal-to-noise-and-distortion ratio. Turning the SNR formula around gives the effective number of bits, defined in tutorial MT-003 and the IEEE 1241 test standard:
ENOB = (SINAD − 1.76) ÷ 6.02
A 12-bit converter with a SINAD of 70 dB performs like an ideal 11.3-bit converter. ENOB, not the headline bit count, tells you how fine a signal you can really resolve.
Sampling and aliasing
A converter only sees its input at the sampling instants. To capture a frequency without ambiguity, it must sample more than twice as fast, so the highest frequency it can represent is half the sampling rate, the Nyquist frequency. A higher frequency does not vanish: it folds back and looks like a lower one. At 100 kHz sampling, a 70 kHz tone appears at 30 kHz, indistinguishable from a real 30 kHz signal. The calculator flags this and shows the alias. A low-pass anti-aliasing filter in front of the converter prevents it.
The table
The table lists the codes, LSB and ideal SNR for common bit depths on your input range, so you can see what moving from 12 to 16 bits buys. Your bit depth is marked.
What the calculator leaves out
It describes an ideal converter with straight binary codes. Reference tolerance and drift, offset and gain errors, differential and integral non-linearity, input impedance and settling, two's-complement output, oversampling gains and the noise shaping of delta-sigma converters all need the datasheet. For the noise of a measured signal, use the signal-to-noise calculator.
More questions
What is the difference between an ADC and a DAC?
An analog-to-digital converter (ADC) measures a voltage and outputs a number; a digital-to-analog converter (DAC) takes a number and outputs a voltage. Both divide their range into 2ⁿ steps, so the same LSB, code and voltage arithmetic applies to both.
How do I read a sensor that outputs more than the ADC's reference?
Scale it down with a resistor divider so the largest sensor voltage stays just below the reference, then multiply the converted voltage by the inverse of the divider ratio. Keep the divider's resistance low enough for the ADC's input to settle within the sampling time.
What is a bipolar ADC range?
A range that runs below zero, such as ±10 V. The codes still count up from the bottom of the range, so with straight (offset) binary coding the middle code stands for 0 V. Some converters output two's complement instead, where 0 V is code 0 and negative voltages have the top bit set.
What is oversampling?
Sampling faster than needed and averaging. If the noise is random and at least an LSB in size, averaging four samples gains about one bit of resolution, because noise falls by the square root of the number of samples. Each extra bit needs four times the samples.
Why is my microcontroller ADC noisier than its bit count suggests?
Digital switching on the same chip, a noisy supply used as the reference, a high source resistance and fast sampling all add noise. A separate reference, a small capacitor at the input pin, slower sampling and averaging usually win back a bit or two.
Sources
This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.