UART Baud Rate Calculator (Divisor & Error)
Calculate the UART baud rate divisor for a microcontroller clock, the actual baud rate, the baud rate error %, the AVR UBRR value, bit and frame time, and the error for every common baud rate.
How it works
divisor = round(f_clk ÷ (oversampling × baud)) · actual baud = f_clk ÷ (oversampling × divisor) · error % = (actual ÷ target − 1) × 100 · AVR UBRR = divisor − 1 · bit time = 1 ÷ baud · frame time = bits per frame ÷ baud
A UART derives its bit clock by dividing the system clock by an integer, so most baud rates come out slightly off. Both ends sample each bit near its middle, and over a 10-bit frame the timing error accumulates; Microchip recommends keeping the error within about ±2% for 8-bit frames, and the combined error of both devices must stay under roughly 4–5%. "Baud-rate" crystals such as 11.0592 MHz or 14.7456 MHz divide exactly into every standard rate.
Worked example
An ATmega328P at 16 MHz with ×16 oversampling targeting 115,200 Bd: 16,000,000 ÷ (16 × 115,200) = 8.68, rounded to a divisor of 9 (UBRR = 8). The actual rate is 16,000,000 ÷ 144 = 111,111 Bd, an error of -3.55% — marginal. Switching to ×8 (U2X) gives a divisor of 17 and an error of +2.12%; 9,600 Bd at ×16 is only +0.16% off.
Sources: Microchip — ATmega328P datasheet, USART baud rate examples · Analog Devices — Determining Clock Accuracy Requirements for UART Communications
Frequently asked questions
What baud rate error is acceptable for UART?
Aim for ±2% or less at each end. Up to roughly ±4.5% total can still work for 8N1 frames if the other device is accurate, but noise and longer frames reduce the margin.
Why does 115200 baud not work well at 16 MHz?
The nearest integer divisor gives 111,111 Bd, 3.5% slow. Use double-speed mode (U2X, +2.1%), a lower rate such as 76,800 or 250,000 (0% error at 16 MHz), or a baud-rate crystal.
What is the difference between baud rate and bit rate?
Baud is symbols per second. For a UART each symbol is one bit, so 115,200 Bd moves 115,200 bits per second including start, parity and stop bits — about 11,520 data bytes per second with 8N1.
What is UBRR?
The USART Baud Rate Register on AVR microcontrollers such as the ATmega328P (Arduino Uno). It holds divisor − 1, where the divisor is the clock divided by 16 (or 8 in double-speed mode) and by the baud rate.
Related calculators
This calculator is for educational purposes. Double-check important results before acting on them.