UART Baud Rate & Frame Timing Calculator
Calculate UART frame timing, throughput, and USART BRR register divisor from baud rate, data format, and MCU clock frequency. Identify baud rate error for reliable serial communication.
16× or 8× oversampling, whole or fractional divisor · asynchronous frame timingAPI slug uart-baud-rate
Inputs
One frame on the wire
sample point · Stop-Bit Sample Offset Δtstop +0.350 bits
Standard values of Baud Rate
Select a row to use it| Baud Rate | Divisor as Set | Actual Baud Rate | Baud Error | Status |
|---|---|---|---|---|
| 104 | 9 615bps | +0.16% | PASS | |
| 52 | 19 231bps | +0.16% | PASS | |
| 26 | 38 462bps | +0.16% | PASS | |
| 17 | 58 824bps | +2.12% | CHECK | |
| 9 | 111 111bps | −3.55% | CHECK | |
| 4 | 250 000bps | +8.51% | CHECK | |
| 2 | 500 000bps | +8.51% | CHECK | |
| 1 | 1 000 000bps | +8.51% | CHECK | |
| 1 | 1 000 000bps | 0.00% | PASS |
- Baud rate error exceeds 2% — may cause framing errors
- Bits per FrameNframe
- 10bits
- Frame PeriodTframe
- 86.81µs
- Data ThroughputTp
- 92.16kbps
- BRR DivisorBRR
- 8.681
- Baud Rate ErrorεB
- 3.55%FAIL
Formula
Microchip ATmega328P datasheet, USART baud rate generator (UBRRn, the whole divisor); STM32 Reference Manual RM0008 §27.3.4 (USARTDIV, the fraction); ST AN2908
| Symbol | Quantity | Your value |
|---|---|---|
| B | Target baud rate (bps) | 115.2 kbps |
| fclk | MCU peripheral clock frequency (Hz) | 16 MHz |
| BRR | Baud rate register divisor (integer) | 8.681 |
| Tbit | Duration of one bit (s) | 8.681 µs |
| Nframe | Total bits per UART frame (bits) | 10 bits |
| D | Data bits (bits) | 8 bits |
| P | Parity bits (0 or 1) (bits) | None |
| S | Stop bits (1 or 2) (bits) | 1 bits |
Assumptions
5 items
- 01A frame is a start bit, 5 to 9 data bits, one parity bit for any parity mode (even, odd, mark or space) and one or two stop bits; the bit period is 1/B and frames follow each other with no idle time, so the throughput counts data bits only.
- 02The divisor is f_clk/(OS·B) at 16× or 8× oversampling, set either as a whole number (AVR's UBRR + 1, the 16550's divisor latch) or with a fraction in steps of 1/OS (STM32's USARTDIV, RM0008 section 27.3.4), rounded to the nearest, a half up; the actual rate is f_clk/(OS × the divisor as set).
- 03The baud error is the actual rate over the target, signed; the error budget, ±2 % by default, is what the link takes with both ends together, and the warning follows it. The other end's own error and the oscillator's tolerance are not added.
- 04The stop-bit sample offset is how far from the first stop bit's centre a receiver running at the actual rate samples a frame sent at the target rate, (k + ½)·(target/actual − 1) bits with k = 1 + data + parity bits; positive is late. The receiver's own sampling step, 1/OS of a bit, is not included.
- 05The drawing is one frame of the byte you give, LSB first, with even parity where parity is on, and the receiver's sample at the middle of each bit; the standard rates are each a calculation at that rate with every other input as entered.
Worked example
STM32 at 16 MHz, 115 200 Bd, fractional divisor
An STM32's USART runs from a 16 MHz peripheral clock at 16× oversampling, and its divisor carries 4 fraction bits. How close to 115 200 Bd does it come, and how far off-centre does the receiver sample the stop bit of an 8N1 frame?
| Step | Expression | Result |
|---|---|---|
| Divisor before rounding | 16 MHz/(16 × 115 200 Bd) | 8.681 |
| Divisor as set, in sixteenths | round(8.681 × 16)/16 | 8.6875 |
| Actual baud rate | 16 MHz/(16 × 8.6875) | 115 108 bps |
| Baud error | (115 108 − 115 200)/115 200 | −0.08 % |
| Stop-bit sample offset | (1 + 8 + ½) × (115 200/115 108 − 1) | +0.008 bits |
How it works
This calculator determines UART baud rate divisor values and timing errors for reliable serial communication. Embedded engineers, IoT developers, and hardware designers use it to configure microcontroller UARTs within the 2-3% clock tolerance required by most receivers. Per the UART standard (derived from RS-232/EIA-232), each frame contains a start bit, 5-9 data bits, optional parity, and 1-2 stop bits. A 16 MHz MCU targeting 115200 baud with 16x oversampling and a whole-number divisor must round 8.68 up to 9 and runs 3.55% slow, outside that tolerance; 8x oversampling (divisor 17) gives 2.12%, and a fractional divisor of 8.6875 brings it to 0.08%. At 9600 baud the divisor 104 gives 0.16%. Standard rates (9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 baud) are defined to minimize divisor rounding errors across common crystal frequencies (8, 12, 16, 20 MHz). The bit period at 115200 baud is 8.68 microseconds, requiring timing accuracy within 300 nanoseconds per bit for reliable 10-bit frame reception.
Practical tips
- Per application note AN4908 from ST Microelectronics, use fractional BRR when available to achieve <0.5% error at any standard baud rate
- For 3.3V logic over cables >2 meters, limit baud rate to 115200 to maintain 400 mV noise margin per RS-232 specifications
- Verify timing with oscilloscope: measure 10 consecutive bits and confirm total duration within 2% of expected (86.8 us at 115200 baud)
Common mistakes
- Counting only the divisor error when the clock is a ceramic resonator: its drift of about 0.5% over -40C to +85C adds to the divisor error, where a 50 ppm crystal adds only 0.005%, so a link that works at 25C can fail at the temperature extremes
- Assuming a standard rate divides every clock evenly: on a 16 MHz clock with a whole divisor, 115200 baud is 3.55% off (111111 baud), while the non-standard 100000 baud is exact (divisor 10)
- Ignoring that fractional baud rate generators (available in STM32, LPC, etc.) reduce the error at 115200 baud on a 20 MHz clock from 1.36% to 0.22%
Frequently asked questions
5 questions
What is the most common UART configuration?
8-N-1 (8 data bits, no parity, 1 stop bit) is used in 90% of embedded applications per industry surveys. This yields 80% efficiency (8 data bits per 10 total bits) and is the default in Arduino, Raspberry Pi, and most microcontroller frameworks.
How does parity bit affect UART communication?
Parity adds 1 bit per frame (reducing efficiency from 80% to 72.7% for 8-N-1 vs 8-E-1) and detects any single-bit error but cannot detect 2-bit errors. Marine NMEA 0183 (IEC 61162-1) runs at 4800 baud with no parity, 8-N-1.
What causes high baud rate errors?
Three factors dominate: crystal tolerance (typical 20-100 ppm, adding 0.002-0.01% error), divisor rounding (from 0 to several percent depending on the clock/baud ratio: 3.55% at 115200 baud on 16 MHz with a whole divisor), and temperature drift (ceramic resonators drift 0.5% over -40C to +85C versus 0.003% for crystals).
Can I use non-standard baud rates?
Yes, and a non-standard rate can be the more accurate one: on 16 MHz, 250000 and 100000 baud are exact (divisors 4 and 10), where 115200 baud is 3.55% off with a whole divisor. Both ends must support the rate. USB-UART bridges like FTDI FT232R support any rate from 183 to 3,000,000 baud.
What's the maximum practical UART baud rate?
Standard UART transceivers support up to 1 Mbaud over PCB traces <10 cm. The FTDI FT232H achieves 12 Mbaud. Beyond 3 Mbaud, use differential signaling (RS-485 supports 10 Mbaud over 15 meters per TIA-485-A).
Shop Components
As an Amazon Associate we earn from qualifying purchases.