Embedded & Electronics Toolkit
← All guides

How Much UART Baud Rate Error Is Too Much?

Every UART tutorial says "keep the baud rate error under 2%". Few say where the number comes from, which makes it hard to judge the cases that matter: a −3.5% divider that seems to work on the bench, a link that only fails on long bursts, or a 9-bit frame on an internal RC oscillator. The rule falls out of a short piece of arithmetic, and once you have it you can work out the budget for your own link.

What the receiver actually does

A UART has no clock line. The receiver waits for the falling edge of the start bit, then uses its own clock to sample each following bit in the middle of the bit period. It never looks at the edges again until the next start bit. Any difference between the transmitter's bit time and the receiver's bit time therefore accumulates across the frame, and resets to zero at the next start bit.

For the usual 8N1 frame there are 10 bits on the wire: one start bit, eight data bits, one stop bit. The last bit the receiver must read correctly is the stop bit, and its centre sits 9.5 bit times after the start edge. The frame is received correctly as long as that last sampling point has not drifted out of its bit, which means the accumulated drift must stay under half a bit:

drift at last sample = 9.5 bit times × relative clock error  <  0.5 bit
relative clock error < 0.5 / 9.5 = 5.26 %

That 5.26% is the total mismatch between the two ends. It is not what each device may contribute, and it assumes a perfect receiver.

Three things that eat the budget

1. Start-edge uncertainty

The receiver finds the start edge by oversampling the line, normally 16 times per bit. It can therefore be late by up to one sixteenth of a bit before it even starts counting. With 8× oversampling the uncertainty doubles to one eighth of a bit. Subtract that from the half-bit margin:

FrameBits on the wireIdeal total budgetWith 16× oversamplingWith 8× oversampling
8N110±5.26%±4.61%±3.95%
8E1 or 8N211±4.76%±4.17%±3.57%
9 data bits + parity, or 8E212±4.35%±3.80%±3.26%

Two things stand out. Longer frames are less tolerant, because the last sample is further from the start edge. And 8× oversampling, which is usually switched on to reach a higher baud rate or a better divider, costs about 0.7 percentage points of margin.

2. There are two clocks

The budget is shared. If both ends are equally bad in opposite directions, each may use half: about ±2.3% for 8N1 at 16× oversampling, and about ±1.9% for a 12-bit frame. This is where the 2% rule comes from. It is the per-device share of a roughly 4% total, rounded down.

It also means the rule is too strict in one common case and too loose in another. If the other end is a USB-serial adapter or a PC with a crystal-derived clock, its error is close to zero and your side can use almost the whole budget. If the other end is another microcontroller on an internal oscillator, 2% on your side may already be too much.

3. The signal is not ideal

Slow edges through an RS-485 transceiver or an opto-isolator, noise, and receivers that take three samples around the bit centre and vote all narrow the usable window further. None of these can be put into a universal number, which is why a design should aim well inside the calculated limit instead of at it.

Where the error comes from

Divider rounding

The baud rate is the peripheral clock divided by an integer, so only some rates are reachable exactly. For 115,200 baud:

Clock and dividerDivider valueActual baudErrorDrift at the stop bit
16 MHz, integer divider, 16×9111,111−3.55%0.34 bit
16 MHz, integer divider, 8×17117,647+2.12%0.20 bit
8 MHz, fractional divider (BRR 0x45)69115,942+0.64%0.06 bit
16 MHz, fractional divider (BRR 0x8B)139115,108−0.08%under 0.01 bit
72 MHz, fractional divider (BRR 0x271)625115,2000%none
14.7456 MHz crystal, integer divider, 16×8115,2000%none

The first row is the classic 16 MHz AVR case. A drift of 0.34 bit is still inside the half-bit limit, which is why the link often works on the bench against a PC. But it has used 3.55 of the 4.61 percentage points available, leaving about 1% for the other end, the oscillator and the signal quality. It fails when any of those gets slightly worse.

The last row is why crystals with odd values such as 14.7456 MHz, 11.0592 MHz and 7.3728 MHz exist. They are multiples of the standard baud rates, so every standard rate divides out exactly.

Oscillator accuracy

Divider rounding is only half of the error. The clock itself is off by its own tolerance, and that adds directly. A crystal is accurate to tens of parts per million, which is thousands of times smaller than the budget and can be ignored. An internal RC oscillator is a different matter: it is often specified at around ±1% at room temperature and noticeably more across the full temperature and supply range. Read the oscillator table in your device's datasheet and add the worst-case figure to the divider error before comparing against the budget.

Symptoms that point to baud error

Measuring the real error

Calculated error tells you what the divider should produce. To see what the board actually produces, transmit the byte 0x55 (ASCII U) continuously. Sent LSB first with a start and a stop bit, it gives a clean alternating pattern on the wire, a square wave at half the baud rate. Measure the width of one bit with an oscilloscope or logic analyser and compare:

Baud rateExpected bit timeSquare wave from 0x55
9,600104.17 µs4.8 kHz
115,2008.68 µs57.6 kHz
921,6001.085 µs460.8 kHz

Measuring across several bits and dividing gives a better result than measuring one. The relative error is the expected bit time divided by the measured bit time, minus one. Do this for both ends of the link and add the two errors, taking the signs into account. If one end is fast and the other slow, the errors add up; if both are off in the same direction, they partly cancel.

A procedure that works

  1. Count the bits in your frame, including start, parity and stop bits, and take the total budget from the first table.
  2. Calculate the divider error for your clock and baud rate.
  3. Add the worst-case oscillator tolerance of your clock source.
  4. Do the same for the other end, or use its documented tolerance.
  5. If the sum is above roughly two thirds of the budget, change something: a fractional divider, a different oversampling setting, a different baud rate, or a crystal.

The two-thirds figure is a design margin for edge quality and noise, not a property of the UART. Use a smaller fraction for long cables and isolated links.

Run the numbers: UART Baud Rate Calculator does this calculation for your own values.

More guides