[{"data":1,"prerenderedAt":300},["ShallowReactive",2],{"blog-post-en-how-we-toss-a-coin":3,"locale-switcher-blog-en-how-we-toss-a-coin":297,"blog-siblings-en-how-we-toss-a-coin":299},{"id":4,"title":5,"_locale":6,"body":7,"date":281,"description":282,"extension":283,"meta":284,"navigation":291,"path":292,"published":291,"seo":293,"slug":294,"stem":295,"__hash__":296},"blog\u002Fblog\u002Fhow-we-toss-a-coin.en.md","How we toss a coin in FlipTheCoin.app","en",{"type":8,"value":9,"toc":266},"minimal",[10,14,18,34,37,42,45,67,74,78,81,86,89,93,96,99,103,114,117,120,124,131,134,138,141,148,180,194,198,201,210,227,236,240,243,257],[11,12,5],"h1",{"id":13},"how-we-toss-a-coin-in-flipthecoinapp",[15,16,17],"p",{},"The mathematics behind a coin flip is simple: a coin has two sides, heads and tails, and each side has an equal chance of landing face up. But how do we actually toss a coin? In this article, we'll explore the science behind coin flips and how we ensure that each flip is fair and random.",[15,19,20,21,25,26,33],{},"You'd be forgiven for thinking a coin flip in a browser is just ",[22,23,24],"code",{},"Math.random()"," dressed up with a pretty animation. That's one way to do it — and we actually offer that flavour in the ",[27,28,32],"a",{"href":29,"rel":30},"https:\u002F\u002Fflipthecoin.app\u002Ftoss-engine",[31],"nofollow","toss engine"," if you want a clean 50\u002F50 result with no drama.",[15,35,36],{},"But the coin you see on the homepage and in our browser extension isn't \"a glorified random number\". It's an actual little physics simulation: a disc, a floor, gravity, and a push. Whichever face ends up looking at the ceiling wins. Let's walk through what that means.",[38,39,41],"h2",{"id":40},"why-simulate-the-physics-at-all","Why simulate the physics at all?",[15,43,44],{},"Two reasons:",[46,47,48,56],"ol",{},[49,50,51,55],"li",{},[52,53,54],"strong",{},"It's more fun to watch."," A thrown, tumbling, bouncing coin feels like a coin. A cutscene that says \"HEADS\" does not.",[49,57,58,61,62,66],{},[52,59,60],{},"It mirrors how real flips work."," In the real world, a coin flip isn't mathematically random — it's a deterministic physical process that's sensitive to the tiny differences in how you launch it. Our simulation has the same character: the randomness sits entirely in ",[63,64,65],"em",{},"how we throw it",", and the rest is physics.",[15,68,69,70,73],{},"If you want a mathematically clean 50\u002F50 (and never an \"edge\"), use the ",[27,71,32],{"href":29,"rel":72},[31],". If you want the real feel, keep reading.",[38,75,77],{"id":76},"the-three-ingredients-of-a-throw","The three ingredients of a throw",[15,79,80],{},"Every time you click the coin, we give it three things: a push up, a little sideways drift, and a spin.",[82,83,85],"h3",{"id":84},"_1-an-upward-push","1. An upward push",[15,87,88],{},"First we shove it up into the air. In our simulation that push is a fixed value — about 9 units of upward velocity — the same every time. This is what sets how long the coin stays airborne. Not random; just enough height for a proper tumble.",[82,90,92],{"id":91},"_2-a-consistent-sideways-lean-with-a-little-variation","2. A consistent sideways lean with a little variation",[15,94,95],{},"If every flip launched from the same spot and landed on the same spot, the coin would pile up like a stack of pancakes. So we also give it a sideways push on both horizontal axes — mostly a fixed value, with a small random addition each time. It's the same general direction every throw (so the coin doesn't fly off screen — or at least not too far), but the exact landing spot varies.",[15,97,98],{},"This is where the randomness comes from in our simulation, we introduce a \"seed\" value that determines the exact direction of the sideways push.",[82,100,102],{"id":101},"_3-a-spin","3. A spin",[15,104,105,106,109,110,113],{},"This is the part that actually decides the outcome. In the pure random mode, we apply a ",[52,107,108],{},"random angular velocity"," between −10 and +10 on two of the three rotation axes — fresh random numbers on every throw. In plain terms: we're telling the coin ",[63,111,112],{},"how fast and in which direction to tumble",".",[15,115,116],{},"We leave the third rotation axis at zero on purpose: it keeps the motion readable instead of letting the coin wobble chaotically in every possible direction at once.",[15,118,119],{},"Once those three values are set, we let go. From there, it's all physics.",[38,121,123],{"id":122},"gravity-does-the-rest","Gravity does the rest",[15,125,126,127,130],{},"The coin lives in a miniature simulated world where gravity is ",[52,128,129],{},"9.82 m\u002Fs²"," — the same pull you'd feel on Earth. It rises, slows down, falls, hits the floor, bounces a little, and eventually settles.",[15,132,133],{},"Crucially, we don't peek at the outcome ahead of time. We don't pre-decide \"this one will be heads\". The simulation runs, the coin does its thing, and whatever it's doing when it stops is what we call the result. In that sense, it's exactly like a real flip: the moment the coin leaves your thumb, the outcome is already decided in principle, but nobody knows what it is until it lands.",[38,135,137],{"id":136},"how-we-read-the-result","How we read the result",[15,139,140],{},"Once the coin stops moving, we need to answer: \"which face is looking at the ceiling?\"",[15,142,143,144,147],{},"The trick is to take a virtual arrow pointing straight ",[63,145,146],{},"up out of the top face of the coin",", and see where it ends up pointing after all that tumbling:",[149,150,151,161,171],"ul",{},[49,152,153,154,157,158,113],{},"If the arrow is pointing roughly ",[52,155,156],{},"up"," — the top face is facing the sky — it's ",[52,159,160],{},"heads",[49,162,163,164,167,168,113],{},"If it's pointing roughly ",[52,165,166],{},"down"," — the top face is now face-down on the floor — it's ",[52,169,170],{},"tails",[49,172,163,173,176,177,113],{},[52,174,175],{},"sideways"," — the coin came to rest balanced on its rim — it's ",[52,178,179],{},"edge",[15,181,182,183,188,189,113],{},"That last one is the rare \"edge\" case mentioned in the ",[27,184,187],{"href":185,"rel":186},"https:\u002F\u002Fflipthecoin.app\u002Fblog\u002Fthe-unexpected-statistics-of-coin-flips",[31],"statistics article"," — the coin balancing on its rim — and it happens in the simulation for the same reason it happens in real life: sometimes the tumble just works out that way. If you're curious why calling it an \"edge case\" is a great pun, I wrote about that ",[27,190,193],{"href":191,"rel":192},"https:\u002F\u002Fflipthecoin.app\u002Fblog\u002Fwhere-does-the-term-edge-case-come-from",[31],"here",[38,195,197],{"id":196},"is-it-actually-random-then","Is it actually random, then?",[15,199,200],{},"Kind of — with a footnote.",[15,202,203,204,206,207,209],{},"The randomness in our flip comes from the random sideways drift and random spin we hand the coin at launch. Under the hood, those numbers come from JavaScript's ",[22,205,24],{},". The physics afterwards is completely deterministic: same inputs, same result, every time. So the simulation inherits whatever quality of randomness ",[22,208,24],{}," provides, stretched across three seeded values.",[15,211,212,213,216,217,222,223,226],{},"Is that \"true\" randomness? No — it's pseudo-random, like most randomness on a computer. Is it random ",[63,214,215],{},"enough"," that you can't game it by clicking in a particular way? Absolutely. And it turns out that's also true of real-world coin flips: ",[27,218,221],{"href":219,"rel":220},"https:\u002F\u002Farxiv.org\u002Fabs\u002F2310.04153",[31],"research has shown"," that real flips are slightly biased towards the side they started on, which means a simulated flip is, ironically, a little ",[63,224,225],{},"more"," fair than the real thing.",[228,229,230],"blockquote",{},[15,231,232,233,235],{},"A simulated flip is, ironically, a little ",[63,234,225],{}," fair than the real thing",[38,237,239],{"id":238},"conclusion","Conclusion",[15,241,242],{},"So the next time you toss a coin on the site, here's what's actually happening: a three-number throw (push, drift, spin), a short physics simulation, and a read of which direction the coin's top face is pointing when it stops. No tricks, no pre-picked winner. Just a very tiny world with very normal gravity.",[15,244,245,246,251,252,256],{},"Curious about the maths underneath? Start with ",[27,247,250],{"href":248,"rel":249},"https:\u002F\u002Fflipthecoin.app\u002Fblog\u002Fprobability-basics",[31],"Probability Basics",". Curious about the weird statistical reality of real coin flips? ",[27,253,255],{"href":185,"rel":254},[31],"The Unexpected Statistics of Coin Flips"," is the one for you.",[15,258,259,260,265],{},"Ready to see the physics in action? ",[27,261,264],{"href":262,"rel":263},"https:\u002F\u002Fflipthecoin.app\u002Fplay",[31],"Flip a coin online"," right now.",{"title":267,"searchDepth":268,"depth":268,"links":269},"",2,[270,271,277,278,279,280],{"id":40,"depth":268,"text":41},{"id":76,"depth":268,"text":77,"children":272},[273,275,276],{"id":84,"depth":274,"text":85},3,{"id":91,"depth":274,"text":92},{"id":101,"depth":274,"text":102},{"id":122,"depth":268,"text":123},{"id":136,"depth":268,"text":137},{"id":196,"depth":268,"text":197},{"id":238,"depth":268,"text":239},"2026-04-23T01:00:00Z","A plain-language tour of the physics behind every coin flip in FlipTheCoin.app — the push, the spin, and the gravity that decides heads or tails.","md",{"excerpt":285},{"type":8,"value":286},[287,289],[11,288,5],{"id":13},[15,290,17],{},true,"\u002Fblog\u002Fhow-we-toss-a-coin.en",{"title":5,"description":282},"how-we-toss-a-coin","blog\u002Fhow-we-toss-a-coin.en","USuVc4TvZoDANEN0K4oT7rt7BmQXKResJCwDrg5mxmA",{"en":294,"es":298},"como-lanzamos-una-moneda",{"en":294,"es":298},1779926069792]