Coin Flipper
Flip a fair, biased, or seeded coin locally, then compare streaks, expected counts, probability gaps, charts, and the session ledger.Latest flip
| Metric | Value | Copy |
|---|---|---|
| {{ row.label }} | {{ row.display }} |
| Check | Current reading | Interpretation | Copy |
|---|---|---|---|
| {{ row.check }} | {{ row.reading }} | {{ row.interpretation }} |
| Flip | Result | Running share | Copy |
|---|---|---|---|
| {{ row.flip }} | {{ row.result }} | {{ row.runningShare }} |
Coin flipping is the simplest useful model for a two-outcome random trial. Heads and tails are easy to name, but the result only makes sense after the probability model is clear. A fair model gives each face the same chance. A biased model deliberately shifts that chance. A recorded run shows the sequence that happened, not a promise about the next face.
The same flip can serve different jobs. A single toss can settle a low-stakes tiebreaker, while a longer run can show how observed percentages move around an expected probability. A seeded sequence helps a lesson, demo, or QA note replay the same order. A fresh random sequence is the better match when the point is an ordinary one-off draw.
| Concept | Plain meaning | Common mistake |
|---|---|---|
| Fair coin | Heads and tails each have probability 0.5. |
Expecting every short run to split exactly in half. |
| Biased coin | One face has a higher configured probability than the other. | Reading bias from a tiny sample instead of the chosen model. |
| Independent flip | Past results do not change the probability of the next draw. | Treating a streak as a sign that the opposite face is due. |
| Seeded sequence | A repeatable pseudo-random order made from the same seed and starting point. | Using repeatability when fresh unpredictability is the goal. |
A fair probability does not promise an even-looking ledger. Ten flips can land six heads and four tails without anything unusual happening. A hundred flips often looks closer to the configured probability, yet the observed share can still miss by several percentage points. That gap is ordinary variation, not a correction mechanism.
Bias is a model choice rather than a finding. If heads is configured at 70%, each draw starts with that same heads chance. The running ledger may land near that share over time, but no individual flip remembers earlier outcomes. Keep the configured probability separate from the observed percentage when reading any session.
Digital coin flips are best treated as lightweight randomness for decisions, games, teaching, and demonstrations. They are not a substitute for audited lotteries, gambling systems, password generation, cryptographic keys, or any process where prizes, money, security, or compliance depend on the result.
How to Use This Tool:
Set the probability model first, then read the latest face and session record together. The first visible flip starts the ledger, and later flips add to the same session until you reset it.
- Choose
System RNGfor ordinary browser-backed flips. ChooseSeeded RNGand enterSeedtext when the same replayable order is more important than fresh randomness. - Set
Bias toward Heads. Leave it at0for a fair50/50model, move it above0to favor heads, or move it below0to favor tails. - Press
Flipto add one result. The summary shows the latest face, total flips, heads and tails counts, percentage split, random mode, configured heads chance, and current streak. - Use
Auto-flip runwhen you need many instant draws for a probability demonstration. Enter a positive whole number; a single batch is capped at5,000flips. - Open
Flip Metricsfor session totals,Expectation Gapfor observed-versus-configured percentages,Probability Checkfor interpretation notes,Flip Distributionfor the heads-versus-tails chart, andFlip Ledgerfor the ordered record. - Use the copy and download actions only after the settings and ledger match the session you want to keep.
- Use
Reset and flipto clear the ledger and immediately start a new one-flip session.
Interpreting Results:
The latest face answers the immediate choice. Counts, percentages, charts, and ledger rows describe the recorded session. Keep those readings separate: one flip can decide a tiebreaker, while a longer run is better for comparing observed frequency with the configured probability.
The Expectation Gap chart compares the session with the current model. A large gap after a few flips is normal. A large gap after hundreds of flips deserves a closer look at Bias toward Heads, RNG mode, seed text, and whether the session was reset before the comparison.
| Signal | Check first | Practical reading |
|---|---|---|
Heads % is far from 50.0 |
Total flips and Bias toward Heads |
Small samples wander. A biased setup may also make 50.0 the wrong expectation. |
Observed Heads gap is positive |
Configured heads chance | The session has more heads than the model's expected share, not proof that the next flip should be tails. |
| All flips show the same face | Bias boundary | 100 forces heads and -100 forces tails after probability clamping. |
| A seeded replay differs from another run | Seed, RNG mode, and starting point |
The same seed must start from the same draw position. Consuming extra flips changes the later order. |
| No sound or vibration occurs | Celebrate Heads, latest face, volume, and device support |
Optional cues fire only on heads when the settings and browser or device allow them. |
Technical Details:
A coin flip is a Bernoulli trial when it has two possible outcomes and a fixed probability for the outcome being counted. Repeating that trial under the same probability creates a binomial setting: the heads count after n flips varies around n x p, where p is the probability of heads.
Independence is the main reading rule. A streak changes the ledger, not the probability of the next draw. If the configured heads probability is 0.5, the next independent flip still uses 0.5 after five heads in a row. If the probability is 0.7, the next flip still uses 0.7 after a tails streak.
Formula Core
Configured heads probability
b is Bias toward Heads as a percentage from -100 to 100. A random draw u in the range [0, 1) records heads when u < pH; otherwise it records tails.
Observed share and expectation gap
Displayed percentages round to one decimal place. Expected counts use the configured probability multiplied by the current flip count.
Bias toward Heads |
Heads probability | Resulting model |
|---|---|---|
-100 |
0.00 |
Tails is forced because all valid draws fail the heads test. |
-40 |
0.30 |
Tails is favored, but heads can still appear. |
0 |
0.50 |
The fair model gives both faces equal probability. |
40 |
0.70 |
Heads is favored, but tails can still appear. |
100 |
1.00 |
Heads is forced because every valid draw passes the heads test. |
System RNG uses browser-provided random values and prefers browser cryptographic randomness when it is available. If that source is unavailable, the random mode label shows a pseudo-random fallback. Seeded RNG turns seed text into a deterministic pseudo-random sequence, which is useful for repeatable lessons and QA examples but not for security-sensitive unpredictability.
| Flip count | Displayed label | How to read it |
|---|---|---|
1 to 9 |
Tiny sample |
Useful for a choice, too small for reading percentage balance. |
10 to 99 |
Short run |
Good for showing variation, still likely to swing after new flips. |
100 to 999 |
Teaching sample |
Large enough for a clearer observed-versus-configured comparison. |
1,000 or more |
Large session |
Better for demonstrations, though still not audited randomness evidence. |
The charts, tables, ledger, and JSON all describe the same recorded session. Exporting a chart image or table preserves the current record; it does not rerun the flips or change the probability model.
Privacy, Accuracy, and Safety Notes:
The flip calculation happens in the browser after the page loads. No account, uploaded file, or server-side lookup is needed for the coin result itself. Saved reports can include visible settings, seed text, counts, charts, and ledger rows, so treat them as records of the session you chose to keep or share.
Browser randomness is appropriate for casual use and teaching demonstrations, but regulated drawings and security tasks need stronger process controls than a web-page result can provide. For passwords, tokens, raffles, sweepstakes, financial games, or compliance-sensitive selections, use a purpose-built system with audit logs and the required legal or security safeguards.
Worked Examples:
One-flip tiebreaker
Keep RNG mode on System RNG and Bias toward Heads at 0. Press Flip once and use the latest face as the tiebreaker. The session counts are just the record of what has happened so far.
Weighted classroom run
Set Bias toward Heads to 40. The Formula Core gives pH = 0.70, so heads is favored on each draw. A run of 100 flips may land near 70 heads, but a visible gap is still possible because the run is random.
Forced-face boundary
Set Bias toward Heads to -100 and run a batch. The ledger records tails for every flip, Heads remains 0, and Tails % reads 100.0 %. That result comes from the configured boundary, not from luck.
Seeded replay check
Switch to Seeded RNG, enter the same Seed, reset, and start from the same point before comparing two runs. A seeded sequence that has already consumed draws will continue from its current position, so later flips can differ even when the seed text matches.
FAQ:
How do I make the coin fair?
Set Bias toward Heads to 0. That makes the configured heads probability 50.0% and the configured tails probability 50.0%.
Why is there already a flip in the ledger?
A starting flip is recorded on load when no previous flip history is present, so the summary and result views have an initial session instead of an empty display.
Why does a fair run look unbalanced?
Fair means equal probability before each draw, not equal counts after every small sample. Short runs often have visible gaps, and even longer runs can miss the expected share by chance.
Can a streak predict the next flip?
No. The current streak counts matching results at the end of the ledger. It does not change the configured probability used by the next independent flip.
Why will Flip xN not run?
Auto-flip run must be a positive whole number. A single batch is capped at 5,000 flips.
Can I use the result for prizes, passwords, or gambling?
No. Use the result for casual decisions, games without monetary stakes, and teaching. Security, regulated drawings, and gambling require purpose-built systems with stronger controls.
Glossary:
- Bernoulli trial
- A random trial with two possible outcomes and a fixed probability for the outcome being counted.
- Binomial setting
- A fixed number of independent Bernoulli trials with the same probability, summarized by the count of one outcome.
- Bias
- The configured shift that raises or lowers the heads probability before a draw is resolved.
- Expected count
- The flip count multiplied by the configured probability, such as expected heads after a given session size.
- Expectation gap
- The difference between the observed heads percentage and the configured heads percentage.
- Seeded sequence
- A repeatable pseudo-random order produced from seed text and a matching starting point.
References:
- 4.3 Binomial Distribution, OpenStax Introductory Statistics 2e.
- Crypto: getRandomValues() method, MDN Web Docs.
- Math.random(), MDN Web Docs.