UART Baud Rate Error & Timing Calculator
Find the divisor, actual baud and error for AVR, STM32 or a generic UART.
UART parameters
UBRR = f / (16 × baud) − 1; baud = f / (16 × (UBRR + 1))Timing and accuracy
UBRR = 103 (0x0067)
Bit time: 104.000 µs
Frame time: 1040.000 µs
Throughput: 961.5 chars/s
Standard baud rates with this clock
| Baud | UBRR | Actual | Error | Status |
|---|---|---|---|---|
| 300 | 3332 | 300.03 | 0.010% | Within 2% |
| 600 | 1666 | 599.88 | 0.020% | Within 2% |
| 1200 | 832 | 1200.48 | 0.040% | Within 2% |
| 2400 | 416 | 2398.08 | 0.080% | Within 2% |
| 4800 | 207 | 4807.69 | 0.160% | Within 2% |
| 9600 | 103 | 9615.38 | 0.160% | Within 2% |
| 14400 | 68 | 14492.75 | 0.644% | Within 2% |
| 19200 | 51 | 19230.77 | 0.160% | Within 2% |
| 28800 | 34 | 28571.43 | 0.794% | Within 2% |
| 38400 | 25 | 38461.54 | 0.160% | Within 2% |
| 57600 | 16 | 58823.53 | 2.124% | 2–4.5%: marginal |
| 76800 | 12 | 76923.08 | 0.160% | Within 2% |
| 115200 | 8 | 111111.11 | 3.549% | 2–4.5%: marginal |
| 230400 | 3 | 250000.00 | 8.507% | Over 4.5%: unreliable |
| 250000 | 3 | 250000.00 | 0.000% | Within 2% |
| 460800 | 1 | 500000.00 | 8.507% | Over 4.5%: unreliable |
| 500000 | 1 | 500000.00 | 0.000% | Within 2% |
| 921600 | 0 | 1000000.00 | 8.507% | Over 4.5%: unreliable |
| 1000000 | 0 | 1000000.00 | 0.000% | Within 2% |
About
Compute start, data, optional parity, and stop bits; derive actual baud from MCU clock and a simple divisor; classify error below 2%, 2–4.5%, or above 4.5%; and compare common baud rates.
Examples
Classic AVR 9600 baud
calculateUartBaudRate({ clockHz: 16_000_000, desiredBaud: 9600, divisor: 103 }){ actualBaud: ~9615.38, baudErrorPercent: ~0.16, reliability: "reliable" }Divisor 103 at 16× oversampling lands 0.16% high — well inside the reliable band.
Parity lengthens the frame
calculateUartBaudRate({ ..., dataBits: 8, parity: true, stopBits: 1 }){ totalBits: 11, byteTimeSeconds: 11 × bitTime }The parity bit adds one frame bit over 8N1, stretching each byte proportionally.
About this tool
UART Baud Rate Calculator sizes serial timing with calculateUartBaudRate({ clockHz, desiredBaud, divisor, dataBits, parity, stopBits, oversampling }) (alias calculateUartBaud): it returns totalBits, bit/byte times, divisor-derived actualBaud, baudErrorPercent, a reliable/caution/risky verdict, and a commonBauds table. The divisor models UBRR-style hardware where actual = clock / (oversampling × (divisor + 1)).
Frame length is exact: totalBits = 1 start + dataBits + parity bit + stopBits, so 8N1 is 10 bits and 8E2 is 12. Reliability comes from classifyBaudError(errorPercent): under 2% is reliable, up to 4.5% is caution, above is risky.
The common table covers COMMON_BAUD_RATES from 1200 to 230400 in ascending order, each with its best-fit divisor, actual rate, error, and verdict — deterministic and fully client-side.
How to use this tool
Enter clock and target
Set clockHz (e.g. 16 MHz), desiredBaud (e.g. 9600), and the UBRR-style divisor (e.g. 103).
Describe the frame
Set dataBits, parity, and stopBits so totalBits and byte time match your 8N1/8E1/8E2 wiring.
Read error and verdict
Compare actualBaud against desiredBaud via baudErrorPercent and the reliable/caution/risky label.
Pick from the table
Scan commonBauds for the lowest-error standard rate your clock can hit cleanly.
Use cases
Sizing UBRR divisors
Prove a clock/divisor pair hits 9600 or 115200 within tolerance before flashing firmware.
Budgeting byte time
Convert frame bits into microseconds per byte for timeout and throughput math.
Choosing a safe baud
Compare the common-rate table to pick the lowest-error standard speed for a given crystal.
Common mistakes
Mistake:Passing divisor 0 and expecting UBRR 0.
Fix:The divisor must be greater than zero here — the formula already adds one, so pass the raw UBRR value ≥ 1 or adjust by one.
Mistake:Ignoring parity/stop bits in timing.
Fix:Byte time scales with totalBits — 8E2 (12 bits) is 20% slower per byte than 8N1 (10 bits) at the same baud.
Mistake:Treating caution as a hard failure.
Fix:Caution (2–4.5%) often works on short, clean links — reserve risky (>4.5%) for re-clocking, not shipping.
Frequently asked questions
What does this tool do?
It computes UART timing with calculateUartBaudRate (alias calculateUartBaud): frame bits, bit/byte times, divisor-derived actual baud, error percent, a reliable/caution/risky verdict, and a sorted common-baud table.
What error should I expect at 16 MHz / 9600 / divisor 103?
About 0.16% high (actual ~9615.38 baud), classified reliable — comfortably inside the under-2% band.
Is my configuration uploaded or stored?
No. Frame math, divisor solving, and error classification run fully client-side.
Why did the divisor throw, or why is a rate risky?
Clock, baud, and divisor must be positive finite numbers — zero or NaN throws. Risky means error above 4.5%; pick a lower-error divisor or standard rate from the table.
Related guides
References & standards
Related tools
.env Secret Safety Linter
Validate .env syntax and spot likely leaked credentials or placeholder secrets.
.gitattributes Generator
Build .gitattributes rules for line endings, Git LFS, GitHub linguist marks and merge drivers — with a one-line explanation for every rule.
.htaccess Generator
Build an Apache .htaccess — HTTPS redirects, rewrites, error pages, security headers, and basic auth
2D Fluid Dynamics & Particle Physics Sandbox
A physics playground with two engines sharing one canvas. The fluid mode runs a real Eulerian Navier-Stokes solver — semi-Lagrangian advection, explicit diffusion, Jacobi pressure projection and vorticity confinement — that you paint with dye and velocity using mouse or touch. The particle mode is a damped Verlet N-body engine with gravity wells, Coulomb attractors and repulsors, spring links, wall restitution and elastic circle collisions. Particle counts adapt to the device (100k target on WebGL2 desktop, 2k-5k on CPU fallback), and every configuration exports as runnable code: a Matter.js world, a PixiJS ticker setup, or a standalone vanilla Canvas engine.
A/B Test Sample Size Calculator
Compute required sample size per variant and test duration from baseline conversion rate, minimum detectable effect, alpha and power.
ABA Routing Number Validator
Validate 9-digit US ABA routing numbers with 3-7-1 Mod-10 breakdown.