How to use this calculator
Estimate the integer UART clock divisor and the actual baud rate for a selected oversampling factor.
- Enter UART source clock (MHz), Target baud rate (bit/s), Oversampling factor. Match the units shown beside each field and review the result together with the assumptions below.
- Read the worked example below to check the expected input format and result.
- Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
How this calculation works
UART baud generators divide a peripheral or selected source clock by an oversampling factor and a programmable divisor. Rounding the ideal divisor to an integer changes the achieved baud rate, so this tool reports the signed error relative to the target.
Inputs and units
clockMhz— UART source clock (MHz)- Peripheral or selected UART source clock in megahertz.
targetBaud— Target baud rate (bit/s)- Desired UART baud rate in bits per second.
oversampling— Oversampling factor- Common UART oversampling selection, 8× or 16×.
Formula
Ideal divisor = fclock ÷ (oversampling × target baud); integer divisor = nearest whole number; actual baud = fclock ÷ (oversampling × integer divisor).
Method
Enter the UART source clock in MHz, desired baud rate, and whether the UART samples at 8× or 16×. The ideal divisor is rounded to the nearest integer and the actual baud and percentage error are computed from that integer.
Worked example
With a 48 MHz source, 115,200 baud target, and 16× oversampling, the ideal divisor is about 26.0417, so the nearest integer divisor is 26. Actual baud is 115,384.615 bit/s, about +0.160% error.
Assumptions and limits
This is a generic integer-divisor model inspired by common UART baud generators. Fractional divisors, alternative clock sources, register offsets, allowable divisor ranges, and sample-mode details vary by microcontroller. Confirm the actual equation and valid divisor range in the device datasheet; baud error alone does not guarantee link compatibility.
Frequently asked questions
Why does actual baud differ from the target?
Many UARTs store an integer clock divisor, so rounding the ideal value changes the achieved baud.
Why can 8× and 16× give different results?
The sampling mode changes the divisor equation and can change the nearest integer divisor.
Is a 16-bit divisor always supported?
No. The 1–65,535 range is an illustrative common model; check the selected MCU's baud generator specification.
How do I use the UART Baud Rate Divisor Calculator?
Enter UART source clock (MHz), Target baud rate (bit/s), Oversampling factor. Match the units shown beside each field and review the result together with the assumptions below.
What is a worked example of UART Baud Rate Divisor?
With a 48 MHz source, 115,200 baud target, and 16× oversampling, the ideal divisor is about 26.0417, so the nearest integer divisor is 26. Actual baud is 115,384.615 bit/s, about +0.160% error.
Reference: Microchip UART baud-rate generator documentation for clock divisors and oversampling. See our calculation methodology.