ADC Code to Voltage Calculator

Convert ADC raw counts to voltage and voltage to ADC counts with configurable resolution, Vref, denominator mode, offset, gain, and optional voltage divider scaling.

ADC raw count and voltage converter

Inputs

Outputs

Max code-
LSB size-
ADC pin voltage (code→voltage)-
Scaled input voltage-
Raw code full-scale percent-
Expected code (voltage→code)-
Voltage→code clamped-
Divider ratio-
Divider current-

Enter ADC settings to convert code and voltage.

ADC code to voltage formula

For an ideal unipolar ADC, voltage is rawCode / denominator × Vref. Common denominator choices are 2^N - 1 (max code) and 2^N depending on datasheet conventions.

Voltage to ADC count formula

For reverse conversion, expectedCode = (voltage / Vref) × denominator, then apply optional offset correction and clamp to valid code range.

ADC resolution and LSB size

LSB size estimates quantization step. Smaller LSB means finer ideal voltage resolution, but real accuracy still depends on ADC nonlinearity, noise, and reference quality.

Using a voltage divider with ADC input

A resistor divider lets you measure higher voltages at an ADC pin. Convert between ADC pin voltage and original input voltage using (Rtop + Rbottom) / Rbottom.

ADC reference examples

Resolution Vref Raw code Voltage Notes
10-bit5.0 V5122.502 VArduino-style ADC midpoint
12-bit3.3 V20481.650 VCommon MCU ADC midpoint
12-bit3.3 V40953.300 VFull-scale code
16-bit3.3 V327681.650 VHigh-resolution midpoint
8-bit5.0 V2555.000 VFull-scale code

Common ADC examples

Typical configurations include 10-bit 5 V Arduino ADC values and 12-bit 3.3 V MCU values. Use this tool for quick checks while debugging firmware telemetry.

FAQ

How do I convert an ADC value to voltage?

Use voltage = rawCode / denominator × Vref. The denominator is usually 2^N - 1 for max-code scaling.

Should I divide by 1023 or 1024 for a 10-bit ADC?

Many calculations use 1023 (2^10 - 1). Some references use 1024. Use the convention that matches your ADC datasheet and firmware implementation.

What is ADC LSB size?

LSB size is the ideal voltage step per code count, usually Vref divided by the chosen denominator.

How do I measure a higher voltage with an ADC?

Use a resistor divider so the ADC pin stays within Vref range, then scale the pin voltage back to original input voltage.

Why is ESP32 ADC reading not exact?

Real ADCs include gain/offset error, nonlinearity, noise, and front-end attenuation behavior. This calculator uses an ideal ADC model for quick estimation.

Related tools