Skip to content
MCUs

UART Baud Rate Calculator

Calculate UART frame duration, bytes per second throughput, and baud rate error percentage for common MCU clock speeds. Helps you pick the closest standard baud rate with acceptable error.

UART Baud Rate & Timing

Calculates the UBRR register value for AVR microcontrollers (Arduino, ATtiny, etc.) to achieve accurate serial communication. Even small per-bit timing errors accumulate across the frame, so staying under 1% error is critical for reliable data transmission. Use Normal mode for most applications; U2X mode doubles the divisor, giving you more precision at higher baud rates.

UART frame sample-point driftstartd0d1d2d3d4d5d6d7stop

Dashed line = ideal sample point per bit · dot = actual sample point with this UBRR value

U2X halves the oversampling divisor — often gets a lower error at low clock speeds.

Baud rate error

-3.55%

UBRR value
8
Actual baud
111,111
Clock used
16 MHz

Try a different clock speed or the nearest standard baud rate.

UBRR = round(F_CPU / (16 × baud) − 1) · actual baud = F_CPU / (16 × (UBRR + 1))

Baud rate and throughput

UART sends each byte inside a frame. With the common 8N1 format that is 1 start bit, 8 data bits, no parity and 1 stop bit: 10 bits per byte. So:

Bytes per second ≈ baud ÷ 10

Baud rateTime per byte (8N1)Max throughput
96001.04 ms960 bytes/s
19 200521 µs1.92 KB/s
57 600174 µs5.76 KB/s
115 20086.8 µs11.5 KB/s
460 80021.7 µs46 KB/s
921 60010.9 µs92 KB/s

Baud rate error

A UART derives its baud rate by dividing a clock. If the division isn't exact, the actual rate differs from the target. Each end samples bits relative to the start bit, so the total mismatch between transmitter and receiver should stay under about 2–3 % for reliable 8N1 communication.

A 16 MHz Arduino Uno at 115 200 baud (with U2X double speed) runs at 117 647 baud: +2.1 % error. That's why Uno-to-device links sometimes drop bytes at 115 200 while 57 600 or 250 000 (0 % error) are perfectly clean. The ESP32's fractional divider keeps error far below 1 % at standard rates.

Fixing garbled serial output

Garbage characters in the Serial Monitor almost always mean a baud mismatch: Serial.begin() in code and the monitor's dropdown must match. ESP32 and ESP8266 also print ROM boot messages at 115 200 (ESP32) or 74 880 (ESP8266) baud before your sketch starts.

Wiring

Cross the lines: TX → RX and RX → TX, plus a common ground. Match voltage levels: connecting a 5 V Arduino TX directly to an ESP32 RX needs a level shifter or a voltage divider.

Formula, inputs and worked examples

Formula and method

For a UART frame, frame time ≈ bits_per_frame / baud; throughput (bytes/s) ≈ baud / bits_per_frame, accounting for start, data, parity, and stop bits.

Worked examples

9600 baud, 8N1

A frame is 10 bits (start, 8 data, stop), so each byte takes 10 / 9600 = 1.04 ms and throughput is 960 bytes per second. A 100-byte message takes about 104 ms.

115200 baud

Each frame takes 86.8 µs and throughput is 11,520 bytes per second, 12 times faster than 9600.

Baud error on a 16 MHz Arduino Uno

At 9600 the baud register value rounds to 103, giving an actual 9,615 baud: +0.16% error, which is fine. At 115200 the normal-mode value of 8 gives 111,111 baud (−3.55%), and the double-speed mode value of 16 gives 117,647 baud (+2.12%). That is why 115200 is less reliable on 16 MHz AVR boards than 9600.

Inputs

  • Baud rate — Unit: bits/s
  • Frame format — Unit: start/data/parity/stop bits

What the result means

  • Frame duration — Unit: s
  • Approximate throughput — Unit: bytes/s
  • Baud-rate error when configured — Unit: percent

Practical tips and common mistakes

  • Both ends must use the same baud rate and frame format. Garbled text in the Serial Monitor usually means a baud mismatch.
  • Keep baud error to a few percent at most; lower is safer, because the receiver samples each bit near its middle and errors add up across the frame.
  • ESP32 boards print boot messages at 115200 baud on the default serial port, so use 115200 in the Serial Monitor to read them.
  • 3.3 V and 5 V TTL levels are not always compatible, and RS-232 levels (±12 V) can damage a microcontroller pin without a level converter such as a MAX3232.

Assumptions and limitations

  • A common 8N1 frame uses 10 bits per data byte: one start, eight data, one stop.
  • Clock error, cable length, electrical levels, and noise affect reliable communication.
  • TTL UART is not electrically interchangeable with RS-232 voltage levels.

Frequently asked questions

How many bytes per second is 115200 baud?

About 11 520 bytes per second with 8N1 framing (10 bits per byte). Real throughput is a little lower due to gaps between bytes.

Why does my Serial Monitor show garbage?

The baud rate in Serial.begin() doesn't match the Serial Monitor setting, or the board's clock is different from what the core expects. Set both to the same value.

What baud rate should I use?

115 200 is the common default for ESP32 and modern boards. Use 9600 for slow devices like many GPS modules and Bluetooth modules (HC-05). Higher rates need short wires.

What does 8N1 mean?

8 data bits, No parity, 1 stop bit. With the start bit that is 10 bits on the wire for every byte of data.

Learn more

More MCUs