Coin Flipper - Flip Fair Coins Online in Browser

Flip one coin or thousands with the Coin Flipper. See heads, tails, and the longest run. Each flip uses crypto.getRandomValues in the browser.

Random results are generated in your browser with crypto.getRandomValues(). Nothing is sent to a server.

01 Generator

    The Coin Flipper returns heads or tails for one flip or a batch up to 10,000 flips in a single run. Enter a flip count, press Flip, and read each outcome plus heads total, tails total, and the longest consecutive run of the same face. Draws use the browser cryptographic random source. Nothing from the flip list is sent to a server.

    Flip a coin once or many times

    Concept diagram: Inputs leads to Flip a coin once or many times leads to ResultInputsFlip a coin once ormany timesResult
    Flip a coin once or many times.

    A single flip settles a binary choice. A larger count builds a short sample of heads and tails for demos, classroom probability, or a best-of series. Set Number of flips from 1 through 10,000, then run Flip. The Coin Flipper lists every face in order, so a series stays auditable without rewriting results by hand.

    Default count is one, which matches the common yes-or-no toss. Raise the count when a lesson needs many trials in one click. Regenerate draws a fresh sequence; previous faces stay on screen only until the next flip replaces them. Cap exists so a tab stays responsive when someone asks for a very large batch.

    Read the heads and tails totals

    Concept diagram: Inputs leads to heads and tails totals leads to ResultInputsheads and tails totalsResult
    Read the heads and tails totals.

    After each run, the Coin Flipper reports how many Heads and how many Tails landed in that batch. For a fair coin, each face has probability 1/2, so the expected heads count in n flips is n/2. Ten flips often land near five heads; one hundred flips often land near fifty. Short samples still wander far from the mean.

    Proportions update with the batch. Heads divided by total flips is the observed heads rate for that run only. The tool does not claim the next flip will correct an imbalance. Each face is drawn independently of earlier faces in the same list.

    Read the longest run

    Concept diagram: Inputs leads to longest run leads to ResultInputslongest runResult
    Read the longest run.

    Longest run is the longest streak of the same face inside the current flip list. Five heads in a row inside twenty flips is a run of five. Runs feel rare in casual talk, yet they appear often in fair sequences. The Coin Flipper tracks the streak as it walks the list so the length matches the faces shown.

    For classroom use, ask students to guess the longest run before revealing the panel, then compare guesses to the measured streak. That habit separates expectation from a single dramatic sequence. Changing the flip count and flipping again produces a new streak length; the prior run does not carry over.

    Verify the coin is fair

    Concept diagram: Inputs leads to Verify coin is fair leads to ResultInputsVerify coin is fairResult
    Verify the coin is fair.

    Each face maps from a uniform integer draw in {0, 1} through the site random helper, which calls crypto.getRandomValues and applies rejection sampling so the two outcomes stay equally likely. The Coin Flipper does not use Math.random. A privacy note on the page states that generated flips stay in the browser.

    Fairness here means equal chance on every flip, not a promise that any short sample will show equal counts. Physical coins can be biased by wear or spin; this digital coin has no physical edge, only the cryptographic draw. If a lesson needs a known unfair coin, this tool is the wrong instrument because both faces share probability one half.

    Understand why 100 flips rarely give exactly 50

    Concept diagram: Inputs leads to why 100 flips rarely give exactly 50 leads to ResultInputswhy 100 flips rarelygive exactly 50Result
    Understand why 100 flips rarely give exactly 50.

    Expected heads in 100 fair flips is 50, yet the chance of landing on exactly 50 is well below certainty. Binomial variance for a fair coin is n/4, so the standard deviation for 100 flips is 5. Outcomes from about 40 through 60 heads are common; an exact split is only one of many plausible totals.

    The Coin Flipper makes that visible: run 100 flips several times and note how often the heads count sits near 50 without matching it. Law of large numbers says the proportion tends toward one half as n grows, not that every round sample hits the mean. Treating a 46 to 54 split as a broken coin confuses variance with bias.

    Work a small probability example

    Concept diagram: Inputs leads to Work a small probability example leads to ResultInputsWork a smallprobability exampleResult
    Work a small probability example.

    Suppose a lesson asks for the chance of heads on one flip. The Coin Flipper models that as 1/2, or 50 percent. For two independent flips, four ordered pairs exist: HH, HT, TH, TT. Exactly one heads appears in HT and TH, so that event has probability 2/4 = 1/2. Exactly two heads has probability 1/4.

    For ten flips, expected heads is 5. A classroom can flip ten times once, record the heads total, then repeat. Across many groups, averages of those totals should cluster near 5 even when individual groups miss 5. The longest-run field on each trial supplies a second statistic students can plot beside the heads count.

    FAQ

    Is each flip independent?

    Each flip is independent of the others in the same batch. Prior heads do not raise or lower the chance of the next heads. The Coin Flipper draws a fresh uniform bit for every face.

    How many flips can one run include?

    One run accepts 1 through 10,000 flips. Counts outside that range return an error instead of a partial list. Split larger classroom experiments across several runs if needed.

    Does the Coin Flipper use Math.random?

    The Coin Flipper does not use Math.random. Faces come from crypto.getRandomValues through the shared site random helper with rejection sampling for a fair two-way split.

    Why show the longest run?

    The longest run makes streaks visible without scanning the full list by eye. Streaks appear in fair data, so the metric supports teaching chance rather than proving bias.

    Are flips sent to a server?

    Flips are not sent to a server. Generation and totals stay in the browser session for that page load.

    Can the coin be biased on purpose?

    This build always uses a 50/50 split. There is no weight slider or loaded-coin mode. For biased trials, another experiment design is required.

    What does a heads count of 60 in 100 flips mean?

    A heads count of 60 in 100 flips is a plausible fair-coin outcome about two standard deviations above the mean, not automatic proof of a broken generator. Repeat the run and compare proportions across trials.

    Does order in the list matter?

    Order matters for reading runs and for replaying a recorded sequence aloud. Totals ignore order and only count faces. Copy the list if a scripted reveal needs the exact sequence.

    Closing summary

    The Coin Flipper turns a flip count into an ordered list of heads and tails, plus heads total, tails total, and longest run, using cryptographic randomness in the browser. Expected balance is n/2, while short samples routinely miss an exact split. Use single flips for decisions and larger batches for probability demos that show variance without inventing bias.