ToolActToolAct

Coin Flip

Flip a coin online, get random heads or tails

HEADS
TAILS

What is a Coin Flip Tool?

A coin flip tool simulates a two-outcome random choice: heads or tails. It works best for quick, low-stakes decisions where both options are acceptable, such as choosing who starts first, which draft to review, or which route to take. The value of an online flip is convenience and repeatable logging: each toss can be recorded so you can see recent outcomes, streaks, and percentages. A fair coin should approach a 50/50 split over many flips, but short runs can look uneven, which is normal probability behavior. This tool is suitable for informal choices, classroom probability demos, and games. It should not be treated as an audited drawing system for prizes, legal decisions, or situations requiring identity verification.

How to Use

How to use

  1. Click the 'Flip Coin' button to start
  2. Watch the coin flip animation and wait for the result
  3. See the result (heads or tails)
  4. History automatically tracks heads and tails counts and percentages
  5. Click 'Clear History' to reset all statistics

Randomness Notes

  • Use the result for casual decisions only; browser randomness is fine for fun but not for gambling, security, or formal lotteries.
  • If several people depend on the result, agree on whether history or repeated flips matter before starting.

Use Cases

Make a visible two-option decisionClick or tap the coin to get heads or tails with animation and generated sound. It fits classroom choices, meeting order, game turns, and small tie-breaks where both outcomes are acceptable. The page is a self-contained browser activity, so no account, app install, or signup is needed to start a single flip.
Track whether a run feels balancedThe page keeps flip history, counts heads and tails, shows percentages, and calculates current and longest streaks so repeated flips are more transparent than a single hidden random call. A short run of one side is normal variance, not a faulty coin, so the running counters are the honest way to read what just happened. The streak field updates after every flip, which makes it easy to see whether a single hot streak is dominating the run or fading back toward 50/50.
Reset the session when the decision context changesClear history before a new game, new group, or new decision so old results do not influence the displayed percentages and streaks. The browser uses crypto.getRandomValues for the source bytes rather than Math.random, which is what makes the per-flip result suitable for fair classroom draws and small contests.
Run a streak experiment in a classroom demoFlip 30 or 50 times in front of students and watch the heads/tails split converge toward 50/50, using the live streak counter to illustrate that short runs of one side are normal variance, not bias. Detecting a real weighted coin statistically needs roughly ten thousand trials; a classroom sample of fifty is enough to teach the idea but never enough to call a coin unfair.
Use the flip history as visible audit trailKeep the on-screen log of timestamps and outcomes during a small contest, raffle, or team-pick so participants can see the sequence and the running count, which deters later disputes about who saw what. The audit log lives in this tab only, so exporting the visible history before closing the page is the simplest way to keep a paper trail, and a screenshot of the running total is enough evidence for a friendly group decision.

Technical Principle

Each flip pulls one byte from crypto.getRandomValues(new Uint8Array(1)) and tests the low bit: 0 maps to tails, 1 maps to heads. The Web Crypto API is required by the WHATWG Web Cryptography specification to source bytes from a cryptographically secure pseudo-random number generator (CSPRNG), typically backed by the OS entropy pool (getrandom on Linux, CryptGenRandom/BCryptGenRandom on Windows, SecRandomCopyBytes on macOS/iOS). Math.random() is explicitly defined as non-cryptographic, returns a 53-bit double from an unspecified algorithm (in V8: xorshift128+), and is observably biased and predictable from a few sample outputs, which is why this tool avoids it for the per-flip decision. By the strong law of large numbers, the empirical heads ratio converges to 0.5 as the number of trials N grows, but for finite N the binomial distribution Bin(N, 0.5) has variance N x 0.25 and a standard deviation of 0.5 x sqrt(N) heads. For N = 100, a 95% confidence band sits at 50 +/- 10, so an observed split of 60/40 is well within normal variance and is not evidence of a biased generator. Streaks follow a geometric distribution: the probability of seeing at least k consecutive heads somewhere in N flips is approximately 1 - (1 - 0.5^k)^(N-k+1), which gives roughly a 17% chance of a run of 6 in 100 flips - again normal, not suspicious. The coin animation is driven by requestAnimationFrame, which syncs to the browser repaint cycle (typically 60 Hz, 16.67 ms per frame, higher on 120 Hz displays), and history is persisted to localStorage so the streak counter survives a page refresh within the same origin. A statistically meaningful test for a real weighted physical coin needs roughly 10,000 trials to detect a 1% bias at 95% confidence; this tool's CSPRNG source eliminates that question for digital flips. For high-stakes raffles or legally binding draws, prefer an auditable third-party RNG service or a certified hardware RNG, since browser-side randomness leaves no externally verifiable trail.

  • crypto.getRandomValues fills a Uint8Array from a CSPRNG; Math.random is not cryptographic and can be predicted.
  • Decision rule: byte & 1, mapping bit 0 to tails and bit 1 to heads (uniform 50/50 over a single bit).
  • Bin(N, 0.5) variance is 0.25 x N; a 60/40 split in 100 flips is well within +/-2 sigma normal variance.
  • Detecting a 1% biased physical coin at 95% confidence needs ~10,000 trials, far beyond classroom samples.
  • Animation is driven by requestAnimationFrame at the display refresh cadence (typically 16.67 ms per frame).
  • Streak counters and history persist via window.localStorage and are scoped to this origin only.
  • Browser-side randomness leaves no externally auditable trail; for legal draws use a certified RNG service.

Examples

10-flip sequence (single session)

Flip #1  -> Heads
Flip #2  -> Tails
Flip #3  -> Tails
Flip #4  -> Heads
Flip #5  -> Heads
Flip #6  -> Heads (streak: 3)
Flip #7  -> Tails
Flip #8  -> Heads
Flip #9  -> Tails
Flip #10 -> Tails
Totals: Heads 5 (50%), Tails 5 (50%)

100-flip statistics (typical run)

Total flips      : 100
Heads count      : 52  (52%)
Tails count      : 48  (48%)
Longest H streak : 6
Longest T streak : 5
Observation      : Short runs rarely land on an exact 50/50 split.

Best of 3 - decide who pays the bill

Person A picks Heads, Person B picks Tails.
Round 1: Heads -> A wins
Round 2: Tails -> B wins
Round 3: Heads -> A wins (final: A 2 - B 1)
B pays the bill.

Classroom probability demo (50 flips)

After 10 flips : H 7  T 3   (70% / 30%)
After 25 flips : H 14 T 11  (56% / 44%)
After 50 flips : H 26 T 24  (52% / 48%)
Lesson: percentages converge toward 50/50 as the sample grows.

FAQ

Is the flip actually random?

Yes. The page uses crypto.getRandomValues from the Web Crypto API, which seeds from the OS cryptographic random pool. Each flip is independent - past results have no influence on the next. Refreshing the page does not reset randomness.

Why did I get five heads in a row?

Random doesn't mean 'evenly alternating'. The probability of five same-side flips in a row is 1/16 ≈ 6.3% - unusual but not rare. Long streaks are normal in any genuine random sequence; perfectly alternating sequences are actually a sign of human bias, not randomness.

Is each flip 50/50?

Yes - exactly. Real coin flips have a tiny physical bias (the side facing up is slightly more likely to land up), but a computer simulator has no such bias - both sides are 50.000…%. Use this for fair tie-breaking.

Is the result fair for a group decision?

Mathematically yes. Socially, the choosing-to-flip-or-not and the after-flip-renegotiate steps matter more than the flip itself. Agree before flipping that the result will be honored.

Can I see statistics for a series of flips?

The page flips one coin at a time and tracks flip history, heads/tails counts, percentages, current streak, and longest streak during the session. The statistics give you a running overview of all flips. History resets when you close the tab or click Clear History.

Are my flip results saved?

Recent flips are kept in your browser tab during the session. Closing the tab usually wipes them; some builds save to localStorage. Nothing is uploaded or shared with anyone else.

Should I use this for legally binding decisions?

For low-stakes choices (who pays for lunch, who goes first), yes. Anything legally binding (custody, contracts, asset division) needs a documented physical procedure with witnesses. A web tool can't be audited after the fact.