Home ↓
CalculatorsVerified

Tech & Digital

ADC Resolution Calculator (LSB Size, Digital Code and SNR)

An analog-to-digital converter, or ADC, turns a continuous voltage into a number that a microcontroller or computer can process. Its resolution, given in bits, sets how many different values it can produce: an n-bit converter has two to the power n levels, so an 8-bit ADC has 256 levels, a 10-bit ADC 1,024, a 12-bit ADC 4,096 and a 16-bit ADC 65,536. The full-scale range, usually set by a reference voltage, is divided into equal steps, each called one least significant bit, or LSB. The LSB size equals the reference voltage divided by the number of levels, so a 10-bit converter with a 5-volt reference resolves steps of about 4.88 millivolts. The digital output code for a given input is the input voltage divided by the LSB, rounded down for a typical converter and limited to the highest code, two to the n minus one. Because the continuous input is rounded to a step, every conversion carries a quantisation error of up to one LSB, which sets a theoretical limit on the signal-to-noise ratio. For a full-scale sine wave, the ideal SNR is 6.02 decibels per bit plus 1.76 decibels. Real converters add noise and distortion, so datasheets quote an effective number of bits. This calculator takes the resolution, the reference voltage and an input voltage, and returns the digital code in decimal, hexadecimal and binary, the LSB size, the number of levels, the quantisation error, the ideal SNR and whether the input is within range.

How to use this calculator

  1. Enter the ADC resolution in bits, such as 10 or 12.
  2. Enter the reference or full-scale voltage.
  3. Enter the input voltage you want to convert.
  4. Read the digital code in decimal, hexadecimal and binary.
  5. Check the step size and ideal SNR.

Getting the most from an ADC

Match the input range to the reference voltage, using amplification if necessary, so the signal uses most of the available codes. A signal that only spans a tenth of the range loses more than three bits of effective resolution.

Averaging several samples, oversampling and dithering can improve effective resolution for slowly changing signals, a technique widely used in microcontroller applications.

Reference and noise

The accuracy of every reading depends on the reference voltage. A noisy or drifting reference adds errors to all measurements, so precision designs use dedicated voltage references rather than the supply rail.

Anti-aliasing filters before the ADC remove frequencies above half the sampling rate, which would otherwise fold back as false signals.

Formula & method

Levels = 2ⁿ; LSB = Vref ÷ 2ⁿCode = ⌊Vin ÷ LSB⌋, limited to 0 … 2ⁿ − 1Ideal SNR = 6.02 n + 1.76 dB (full-scale sine wave)Maximum quantisation error = ±½ LSB (rounding converters) or 1 LSB (truncating)

Levels = 2ⁿ, LSB = Vref/2ⁿ, code = ⌊Vin/LSB⌋ limited to 2ⁿ − 1, and ideal SNR = 6.02n + 1.76 dB.

Worked example

A 10-bit ADC with a 5 V reference measuring 2.5 V

  1. Levels = 2¹⁰ = 1,024; LSB = 5 ÷ 1,024 = 4.8828 mV
  2. Code = 2.5 ÷ 0.0048828 = 512 (0x200)
  3. Ideal SNR = 6.02 × 10 + 1.76 = 61.96 dB

Answer: Half of full scale gives code 512, exactly the middle of the range.

Frequently asked questions

What is an LSB?

The least significant bit is the smallest voltage step the ADC can distinguish, equal to the reference voltage divided by the number of levels.

What is the maximum code?

For an n-bit converter it is 2ⁿ − 1, such as 1,023 for 10 bits or 4,095 for 12 bits. Inputs at or above the reference voltage give this code.

Why is the SNR formula 6.02n + 1.76?

Each extra bit halves the quantisation step, improving SNR by 20 log₁₀(2) ≈ 6.02 dB. The 1.76 dB term comes from comparing a full-scale sine wave with uniform quantisation noise.

What is ENOB?

The effective number of bits describes real performance: ENOB = (SINAD − 1.76) ÷ 6.02, using the measured signal-to-noise-and-distortion ratio from the datasheet.

Do all ADCs round down?

Many ADCs are designed so their transitions occur at half an LSB, effectively rounding to the nearest code. Check the datasheet transfer function for your part.

Can I measure negative voltages?

Only with a bipolar ADC or by shifting the signal with an offset circuit. This calculator assumes a unipolar range from 0 V to the reference.