UART Baud Rate Error Calculator

See how close a microcontroller's UART can get to a standard baud rate with a given clock, and whether the error is small enough to communicate reliably.

Divider register
Actual baud rate
Error
Verdict

Runs entirely in your browser. Nothing you enter is sent anywhere.

How it works

Many UARTs, including AVR-based Arduino boards, derive the baud rate by dividing the system clock by 16 (or 8 in double-speed mode) and by an integer register value. Because the divider must be a whole number, some clock and baud combinations can't be hit exactly.

Both ends of a link tolerate only a small mismatch. Keeping the error within about ±2% is a common rule; larger errors cause corrupted characters, especially with long frames.

Divider = round(f_clk / (16 × baud)) − 1
Actual baud = f_clk / (16 × (Divider + 1))
Error = (Actual − Target) / Target
(use 8 instead of 16 in double-speed mode)

Worked example

A 16 MHz board at 115,200 baud gives 16,000,000 / (16 × 115,200) = 8.68, so the divider is 8 and the actual rate is 111,111 baud, an error of −3.5%. In double-speed mode the divider is 16, the rate 117,647 baud and the error +2.1%, which works far more reliably.

Frequently asked questions

Why does 115200 baud fail on some 16 MHz boards?

The nearest achievable rate in normal mode is 3.5% off. Enabling double-speed (U2X) mode, or using a 14.7456 MHz 'baud rate' crystal, brings the error down.

Does this apply to ESP32 or STM32?

They use fractional baud rate generators that hit standard rates far more precisely, so the error is usually negligible. This calculator models the classic integer divider.

Related tools