·3 min read

Turning a Coin Flipper Into a Daily Game

My little coin flipper grew up. Call every flip, one miss ends your run, and your best run goes on the board.

flip-a-coin

Back in March of last year I built a coin flipper. One page, one button, a coin that spins and lands on heads or tails. I even had it pull numbers from Random.org so the flips would be "truly" random, which in hindsight is a lot of ceremony for a coin. It did its job and I forgot about it.

Then in September I came back to it with a different idea. What if you had to call the flip? That's what it is now. Let's get into it.

How it works

Pick heads or tails, then flip. Every right call adds one to your streak. One wrong call ends the run. You get three runs a day of up to 20 flips each, and your best one goes on the leaderboard. Everything resets at midnight UTC, and playing on back-to-back days builds a day streak.

Getting all 20 is roughly a one in a million day. I would love to see someone pull it off.

There's a board for today, one for today in your country, and one for all time. You can also make a friends board, drop the invite link in the group chat, and see everyone's best run each day. Once your day is done there's a Wordle-style share button that gives you one line of coins per run.

And if you just need to flip a coin to settle something, that still works. Flipping without calling a side is free practice and never touches your run.

Keeping it fair

A leaderboard built on pure luck is very easy to cheat, so the server decides every flip before you see it. Each run's 20 flips come from a secret mixed with the day and your player id, and your browser only ever says which side you called. Nobody can peek ahead, me included. Clearing your id gets you a new random sequence, not a better one.

The privacy bits

You don't need an account. You get a random id in your browser and can pick a nickname if you want your name on the board. No IP addresses are written to the database or the logs. There are no third-party trackers. The only analytics are a first-party visit counter and a copy of Umami I host myself, and if your browser has Do Not Track turned on, neither one counts you. The country stats come from a header the host sets, not from anything stored about you.

Small things I like

The sounds are made in the browser with Web Audio, so there are no audio files to download. Space flips, H and T call a side. You can add it to your home screen like an app. Under the hood it's Next.js 16, Tailwind v4, shadcn/ui and a libSQL database, all self-hosted.

Give it a go at flip-a-coin.everone.co. If you make it past 10, I want to hear about it.

Thanks for reading.