Percentages and Math

UART Baud Rate Error Calculator

Enter the clock frequency and the baud rate you want to get the register value and the error.

Your numbers

The clock that feeds the UART, such as 16 for 16 MHz.

Result

Baud rate error

+0.16%

Register value 103 gives 9615.385 baud. Within about 2%, which most links tolerate.

Register value
103
Actual baud rate
9615.385
Error
+0.160%
Divisor
104

Standard rates at 16 MHz, 16 samples per bit

WantedRegisterActualError
12008321200.48+0.04%
24004162398.082-0.08%
48002074807.692+0.16%
96001039615.385+0.16%
144006814492.75+0.64%
192005119230.77+0.16%
288003428571.43-0.79%
384002538461.54+0.16%
576001658823.53+2.12%
768001276923.08+0.16%
1152008111111.1-3.55%
2304003250000+8.51%
2500003250000+0.00%
5000001500000+0.00%
100000001000000+0.00%
How this was calculated
  1. The UART divides the clock by 16 x the divisor: baud = f / (16 x (register + 1)).
  2. Ideal divisor = 16000000 / (16 x 9600) = 104.16667, rounded to 104, so the register holds 103.
  3. Actual baud = 16000000 / (16 x 104) = 9615.385. Error = (actual - wanted) / wanted = 0.1603%.
  4. Both ends of a link have their own error. A common rule of thumb for 8N1 frames is to keep the total within about 3 to 4 percent, so each end should stay under about 2 percent.
  • Registers and rounding rules differ by chip. This page follows the common integer divisor scheme. Check your data sheet for fractional dividers and for the exact register formula.

Calculated using SumPanda.com · https://sumpanda.com/uart-baud-rate-error-calculator/

Results are estimates for general information. Verify important figures before relying on them.

Next step

How to use the uart baud rate error calculator

  1. Enter the clock frequency that feeds the UART, in megahertz.
  2. Enter the baud rate you want and choose the samples per bit: 16 for normal mode, 8 for double speed.
  3. Tick the box if your register holds the divisor minus 1, as on AVR chips; leave it clear if it holds the divisor itself.
  4. Read the register value, the actual baud rate, the error and the table of standard rates for your clock.

Formula

Actual baud = f_clock / (S x divisor), with S the samples per bit (16, 8 or 4)

Ideal divisor = f_clock / (S x wanted baud), rounded to the nearest whole number

AVR style register: UBRR = round(f_clock / (S x baud)) - 1, and the divisor is UBRR + 1

Error % = (actual baud - wanted baud) / wanted baud x 100

Rounding the divisor to a whole number is the only source of error here, so a clock that is a multiple of 1.8432 MHz gives exact standard rates.

A 16 MHz microcontroller

At 16 MHz with 16 samples per bit, 9600 baud needs a divisor of 104.17, rounded to 104, so the register holds 103 and the actual rate is 9615.385 baud, an error of +0.16%. For 115200 baud the register is 8, the actual rate is 111,111.1 baud, and the error is -3.55%, too large for reliable use. With 8 samples per bit (double speed), the register is 16, the actual rate is 117,647.1 baud, and the error is +2.12%.

At 8 MHz, 9600 baud gives a register value of 51 and +0.16%. A 1.8432 MHz clock gives register 0 and an exact 115,200 baud, and at 16 MHz 250,000 baud is exact with register 3. These values match the tables in the data sheet of the ATmega328P.

Why the error matters

A UART has no shared clock. The receiver finds the start of each byte from the falling edge, then samples each bit at the middle of its time slot, relying on its own clock to keep time. If the two sides disagree on the bit time, the sample point drifts across the frame. By the last bit of a ten-bit frame the drift is ten times the per-bit error, and it must stay under half a bit, which sets a limit of about 5% total, or roughly 2% on each side to leave margin.

If you can, pick a clock that divides well: crystals at 1.8432, 3.6864, 7.3728 and 11.0592 MHz give exact standard rates. For other settings, the table shows the error for every common rate at your clock so you can choose a rate that works. For the number of bits a converter produces, see the ADC resolution calculator.

Chip differences

Chips differ in how the divisor is stored. Many AVR parts hold the divisor minus 1 in a 12-bit register and can switch to double speed. Other families use a fractional divider with extra bits, or a prescaler followed by a counter, so always check the formula in your data sheet. This page uses the common whole-number divisor scheme and tells you which register value to expect.

Related timing tools include the 555 timer calculator for oscillator frequency and the RC filter time constant calculator. Hexadecimal register values can be checked with the binary calculator.

Assumptions and limits

  • The clock is accurate; a real crystal or oscillator adds its own error, which also counts against the budget.
  • The divisor is a whole number. Fractional dividers give smaller errors and are not modeled.
  • The guideline of about 2% per end is a rule of thumb for 8N1 frames.
  • Samples per bit can be 16, 8 or 4; some chips offer other settings.

Formulas reviewed October 10, 2026. See the calculation methodology for how SumPanda rounds, tests and sources its formulas.

Frequently asked questions

What is baud rate error?

The difference between the baud rate you want and the one the divider produces, as a percentage of the wanted rate.

How much error is acceptable?

Keep it under about 2% at each end for a standard frame. The two errors add if they go in opposite directions.

What is UBRR?

The USART baud rate register on AVR chips. It holds the divisor minus 1.

Why is 115200 baud poor at 16 MHz?

Because 16 MHz divided by 16 x 115200 is 8.68, which rounds to 9 and gives an error of about 3.5%. Double speed mode or a different crystal fixes it.