Enter the duty cycle (%) and reference voltage into the calculator to determine the average DC voltage output from a PWM signal. This tool supports fixed 5 V systems, custom reference voltages (3.3 V, 12 V, 24 V), and RC low-pass filter ripple estimation.

PWM to Voltage Calculator

Fixed 5 V
Custom Vref
PWM RC Filter

Enter any 1 value to calculate the other

PWM to Voltage Formula

The average DC voltage produced by a PWM signal is calculated as:

V_{avg} = \frac{D}{100}\times V_{ref}

Where V_avg is the time-averaged output voltage in volts, D is the duty cycle expressed as a percentage (0 to 100), and V_ref is the high-level voltage of the PWM signal (the supply rail or logic-high voltage).

This formula works because PWM rapidly switches between 0 V and V_ref. Over one complete period T, the signal is high for a duration of D/100 * T and low for the remainder. Integrating the voltage over the full period and dividing by T yields the linear relationship above. The result is purely proportional: doubling the duty cycle doubles the average voltage.

What PWM Actually Does Electrically

A PWM signal is a rectangular waveform that alternates between ground (0 V) and the supply voltage at a fixed frequency. It is not an analog voltage. The signal is always either fully on or fully off at any given instant. What changes is the ratio of on-time to total period, called the duty cycle.

When a load with sufficient inertia or capacitance receives this signal (a motor winding, an LED through a filter, a heated element), it responds to the average power delivered over each switching cycle rather than the instantaneous transitions. This is why a 50% duty cycle at 5 V delivers the same heating power to a resistive load as a steady 2.5 V DC source, even though the instantaneous voltage never actually sits at 2.5 V.

For applications requiring a true analog voltage (sensor reference inputs, analog control loops, audio DACs), the PWM signal must pass through a low-pass filter to remove the switching component. The calculator’s RC Filter tab handles this case directly.

Duty Cycle to Voltage Reference Table

The table below provides pre-calculated average voltages for the four most common logic and power supply levels used with PWM signals.

PWM Duty Cycle to Voltage (V) for 3.3 V, 5 V, 12 V, and 24 V Systems
Duty Cycle (%)3.3 V System5 V System12 V System24 V System
00.0000.0000.0000.000
50.1650.2500.6001.200
100.3300.5001.2002.400
200.6601.0002.4004.800
250.8251.2503.0006.000
300.9901.5003.6007.200
33.31.0991.6653.9967.992
401.3202.0004.8009.600
501.6502.5006.00012.000
601.9803.0007.20014.400
66.72.2013.3358.00416.008
752.4753.7509.00018.000
802.6404.0009.60019.200
902.9704.50010.80021.600
1003.3005.00012.00024.000
Formula: V_avg = (Duty / 100) x V_ref. Values rounded to 3 decimal places.

8-Bit Digital PWM Values (0 to 255)

Most microcontrollers (Arduino Uno, ATmega328P, ESP8266, many STM32 timers) use 8-bit PWM resolution by default. The duty cycle register accepts integer values from 0 to 255, where 0 is always off and 255 is always on. The conversion from an 8-bit register value to average voltage is:

V_{avg} = \frac{\text{PWM Value}}{255}\times V_{ref}
8-Bit PWM Register Value to Voltage (5 V and 3.3 V Systems)
PWM Value (0-255)Duty Cycle (%)Voltage at 5 VVoltage at 3.3 V
00.00.0000.000
10.40.0200.013
3212.50.6270.414
6425.11.2550.828
12749.82.4901.643
12850.22.5101.656
19174.93.7452.471
19275.33.7652.484
22487.84.3922.899
25499.64.9803.287
255100.05.0003.300
Formula: V = (PWM_value / 255) x V_ref. Used by analogWrite() on Arduino and similar platforms.

Note that 8-bit resolution provides only 256 discrete voltage steps. For a 5 V system, each step is approximately 19.6 mV. Applications requiring finer control (audio DACs, precision sensor excitation) typically use 10-bit (1024 steps, ~4.9 mV per step at 5 V), 12-bit (4096 steps, ~1.2 mV), or 16-bit (65,536 steps, ~76 uV) PWM resolution.

PWM Frequencies by Platform

The PWM frequency determines how many switching cycles occur per second. Higher frequencies produce smoother filtered output but increase switching losses. Lower frequencies are easier to filter but can cause audible noise in motor and inductor-based applications (the human hearing range extends to roughly 20 kHz). The table below lists default and configurable PWM frequencies for widely used microcontroller platforms.

Default PWM Frequencies and Resolution by Microcontroller
PlatformDefault FrequencyDefault ResolutionMax ResolutionLogic Voltage
Arduino Uno (ATmega328P)490 Hz (pins 3,9,10,11) / 980 Hz (pins 5,6)8-bit8-bit (timer-limited)5 V
Arduino Mega (ATmega2560)490 Hz / 980 Hz8-bit8-bit5 V
ESP325,000 Hz (typical)8-bit16-bit3.3 V
ESP82661,000 Hz10-bit10-bit3.3 V
STM32 (e.g., F103)Configurable (1 kHz typical)16-bit16-bit3.3 V
Raspberry Pi Pico (RP2040)Configurable16-bit16-bit3.3 V
PIC18 (Microchip)Configurable10-bit10-bit3.3 V or 5 V
Actual frequency depends on timer prescaler and clock settings. Values shown are common defaults.

RC Low-Pass Filter Design for PWM

To convert a PWM signal into a stable analog voltage, a first-order RC low-pass filter is the most common approach. The filter’s cutoff frequency (fc) must be set well below the PWM switching frequency so that the capacitor charges and discharges only slightly within each cycle, producing a nearly constant DC output with small ripple superimposed.

The cutoff frequency of a single-stage RC filter is fc = 1 / (2 * pi * R * C). The design tradeoff is direct: lowering fc (larger R or C) reduces ripple but increases the time the output takes to settle after a duty cycle change. Raising fc (smaller R or C) speeds up response but allows more ripple through.

A practical rule of thumb for 8-bit accuracy (ripple below ~19.6 mV on a 5 V system): set the RC time constant to at least 64 times the PWM period. At a PWM frequency of 1 kHz (period = 1 ms), this means RC should be at least 64 ms. A 10 kohm resistor with a 10 uF capacitor gives a time constant of 100 ms and a cutoff frequency of about 1.6 Hz, which comfortably meets that requirement. The settling time to reach the new voltage within 1 LSB after a full-scale duty cycle change is approximately 5 * RC, or about 500 ms in this example.

For faster settling with the same ripple performance, increase the PWM frequency rather than decreasing the RC values. Doubling the PWM frequency halves the required RC time constant for the same ripple specification, cutting settling time in half as well. This is one reason high-frequency PWM (20 kHz and above) is preferred in precision analog output applications.

Common PWM Voltage Applications

LED Dimming: LEDs are typically driven at PWM frequencies of 1 kHz or higher. Because human vision averages the rapid flicker, a 25% duty cycle appears roughly 25% brightness. No analog conversion is needed; the LED sees full forward voltage during the on-time and zero during off-time. The perceived brightness follows a nonlinear curve (closer to a power law with an exponent around 2.2 to 2.5), so firmware often applies gamma correction lookup tables to make the dimming appear perceptually linear.

DC Motor Speed Control: PWM at frequencies between 1 kHz and 25 kHz controls the effective voltage across a DC motor. The motor’s inductance acts as a natural low-pass filter, smoothing the current waveform. At 50% duty cycle with a 12 V supply, the motor receives an average of 6 V. Operating below approximately 18 kHz can produce audible whine from the motor windings; industrial motor controllers typically use 20 kHz or above to stay above the audible range.

Switched-Mode Power Supplies (SMPS): Buck, boost, and buck-boost converters use PWM at frequencies from 100 kHz to several MHz to regulate output voltage. The duty cycle directly sets the voltage conversion ratio. In a buck converter, V_out = D * V_in. A 48 V to 12 V buck converter operates at 25% duty cycle. The LC output filter in SMPS circuits serves the same role as the RC filter discussed above but handles higher power levels with lower losses.

Servo Motor Positioning: Standard hobby servos expect a PWM signal at 50 Hz (20 ms period). The pulse width, not the duty cycle, encodes the position: 1.0 ms corresponds to 0 degrees, 1.5 ms to 90 degrees (center), and 2.0 ms to 180 degrees. This maps to duty cycles between 5% and 10% at 50 Hz. The voltage of the PWM signal (typically 3.3 V or 5 V) only needs to meet the servo’s logic-level input threshold.

Audio Signal Generation: Class-D audio amplifiers convert analog audio into a PWM stream at switching rates of 300 kHz to 1.5 MHz. An LC reconstruction filter at the output removes the carrier frequency, leaving only the audio-band signal. Achieving greater than 90 dB signal-to-noise ratio requires PWM resolutions of 12 bits or more combined with advanced modulation techniques like sigma-delta encoding.

Key Differences: Average Voltage vs. RMS Voltage from PWM

The formula V_avg = (D/100) * V_ref gives the time-averaged (DC) voltage, which is the value relevant for filtered analog outputs and average power into resistive loads. However, the root-mean-square (RMS) voltage of an unfiltered PWM signal is different:

V_{rms} = V_{ref}\times\sqrt{\frac{D}{100}}

At 50% duty cycle with a 5 V reference, V_avg = 2.500 V while V_rms = 3.536 V. The RMS value matters for calculating power dissipation in resistive loads driven by unfiltered PWM, since P = V_rms^2 / R. For a purely resistive 100 ohm load at 50% duty cycle and 5 V, the power is 0.125 W (from V_rms) not 0.0625 W (which would be incorrectly derived from V_avg). After filtering through an ideal low-pass filter that removes all AC content, the output voltage becomes essentially DC at V_avg, and V_rms converges to V_avg.