⭐ 0

Coin Flip — Flip a Coin Online

Flip one to ten coins. Each face is the low bit of a crypto.getRandomValues byte. The counters start at zero and ignore the face that is already showing.

Processed entirely in your browser — nothing you enter here is ever uploaded.

Heads
0
Tails
0
Total flips
0
Streak
—
Processing... 0%

Result

About this tool

The count field opens at 1 and is clamped to the integers 1 through 10. A blank, or any value that does not parse, becomes 1. Each coin draws one byte from crypto.getRandomValues and keeps the low bit. An even byte is heads. An odd byte is tails. That is a fair bit. The byte is not used as a weighted threshold. When the count changes, new coins are added with a face already painted, and extra coins are dropped. Those painted faces are not added to the heads or tails counters. Only a press of Flip is counted. The board shows a gold heads side with a star and a gray tails side with a disc, and the word under the coin comes from the page language.

Flip refuses to start while a spin is running. Each coin draws a new bit, then the rotation continues from the last settled angle, adds 1080 degrees, which is three full turns, and adds another 180 degrees when the result is tails. The CSS transition lasts 900 ms. Fifty milliseconds after that, each coin in board order increments heads or tails and updates the streak. The streak is not per coin. It is the latest run of identical faces in the order the coins are registered, so three coins that land heads, heads, tails finish on tails × 1, and three heads in a row finish on heads × 3. The total is heads plus tails. Before the first flip the streak line is a dash.

Reset sets heads, tails, and the streak back to zero and leaves the coins where they are. It does not draw new faces. Preset pages set the count to 2 or to 3 before the board is built. There is no weight, no history log beyond the four numbers, and no seed you can type. The generator is the browser's crypto.getRandomValues, not Math.random. Closing the tab drops the totals. They are not stored.

Each coin is a 92 by 92 pixel disc. Heads is the gold gradient with a star. Tails is the gray gradient with a filled disc. The spin uses cubic-bezier(0.2, 0.7, 0.25, 1) across the 900 ms. One flip of 10 coins draws 10 bytes and adds 10 to the total, because the total is heads plus tails and every coin lands on one of those two. A typed 0 is rewritten to 1, and a typed 11 is rewritten to 10, on input. The two-coin and three-coin preset pages only set that count. They do not arrive with a heads or tails total already filled in.

Example. Each coin reads one crypto byte and keeps the low bit. Even is heads, odd is tails. The count is clamped to 1–10, and the spin lasts 900 ms.

Limit. The face painted before the first flip is not counted. Reset clears the totals and does not reroll. The streak follows board order, not one coin.

Frequently asked questions

How is heads chosen?

crypto.getRandomValues fills one byte. The low bit even is heads and odd is tails. It is not Math.random, and it is not a weighted coin. The count field accepts 1 through 10.

Why is the total still zero after the page loads?

The opening face is drawn so the coin is not blank, and it is excluded from the counters. Only Flip adds to heads, tails, and the streak, after the 900 ms spin.

How does the streak work with three coins?

Results are applied in board order. Three heads finish as heads × 3. Heads, heads, tails finishes as tails × 1. The streak is one run across the board, not a separate run per coin.

What does reset do?

Heads, tails, and the streak go back to zero. The coins keep the face they already show. Preset pages start with 2 or 3 coins. Totals are not saved.