Skip to content
Tool

Coin Flip Simulator

Flip a fair or biased coin with secure randomness, run large experiments, and export results. Live animation, stats, streaks, and CSV/JSON downloads.

For very large N, use backend CSV/JSON.

Last flip
Heads: 0
Tails: 0
Heads %: 0%
Tails %: 0%
Longest H streak: 0
Longest T streak: 0
Results preview

              
Secure RNG
Reproducible (seeded)
CSV export
Live stats

How it works

1) Pick randomness

Secure (cryptographic), seeded (reproducible), or fast (browser PRNG).

2) Choose N and bias

Flip once with animation or run thousands with a custom Heads probability.

3) Export

Copy the sequence or download CSV/JSON. Use the backend for huge runs.

Randomness 101: Fair coins, PRNGs & seeds

What makes a coin flip "random"? When should you use cryptographic randomness vs a seeded PRNG? How big should N be to see ~50/50?

Fair vs biased

A fair coin has p = 0.5 for Heads each flip. A biased coin has p ≠ 0.5. Our tool lets you set p to simulate weighted coins.

Random number generators

  • Secure: cryptographically strong randomness from the browser (Web Crypto).
  • Seeded: reproducible pseudo‑randomness; same seed → same sequence.
  • Fast: the browser’s Math.random(), quick but not cryptographically strong.

Law of large numbers

As N grows, the observed Heads % will tend toward the true probability p. Expect short‑term swings for small samples.

Streaks happen

Consecutive Heads or Tails streaks are common in random sequences. Long streaks don’t "correct themselves" — each flip is independent.

FAQ

What’s exported to CSV?

Two columns: index (1‑based) and result (H/T). Use backend for very large runs.

Are results truly random?

The Secure mode uses cryptographic randomness from your device. Seeded and Fast are pseudo‑random, good for demos and reproducibility.