The Widmark formula has estimated blood alcohol content since 1932, and it's still the basis for most BAC calculators today. It's also never been a substitute for judgment.
Widmark formula calculator, the math behind the estimate
The formula factors in grams of alcohol consumed, body weight, a sex-specific body-water distribution ratio (0.68 for men, 0.55 for women), and time elapsed (the body metabolizes roughly 0.015% BAC per hour). For an 80 kg man having 3 standard drinks (42g alcohol) over 2 hours, it estimates 0.047% BAC.
How many drinks to reach 0.08, and why that's the wrong question
The US legal driving limit is commonly 0.08%, but meaningful impairment — slower reaction time, reduced coordination — begins well below that threshold for most people. Treating a legal limit as a safety threshold misses the point.
Bac estimate calculator, what it can't account for
This formula doesn't know whether you've eaten, what medications you're on, your liver function, or your actual body fat percentage — all of which meaningfully change real BAC. If you've been drinking, the only safe choice is not to drive, regardless of what any calculator says.