ツール ガイド
generators 無料 サインアップ不要

ランダムジェネレーター(サイコロ、コイン、カード)

サイコロを振ったり、コインを投げたり、ランダムにカードを引いたり、乱数を生成したりします。すべて暗号学的にランダムです。

ツールを読み込み中…

このツールについて

ゲーム、決定、シミュレーションのために真のランダムな結果を生成します。複数のサイコロ(d4、d6、d8、d10、d12、d20、d100)を振る、複数のコインを投げる、シャッフルされたデッキからランダムにトランプを引く、または任意の範囲の乱数を生成できます。すべてのランダム性はWebCrypto APIを使用しています。

使い方

  1. 1 タブを選択してください:サイコロ、コイン、カード、または数値。
  2. 2 ロール設定を構成してください。
  3. 3 「ロール/フリップ/引く」をクリックして生成してください。
  4. 4 結果は最近のロールの履歴とともに表示されます。

What "truly random" means here

There are two grades of randomness in software. The everyday kind, produced by Math.random(), is a fast pseudo-random sequence that is fine for shuffling a playlist but is technically predictable if you know its internal state. The stronger kind comes from the browser's WebCrypto API via crypto.getRandomValues(), which draws from the operating system's cryptographic entropy pool — the same source used to generate encryption keys. This generator uses the cryptographic source for every dice roll, coin flip, card draw, and number, so each outcome is genuinely unpredictable rather than merely hard to anticipate.

How a fair roll avoids hidden bias

Getting an unbiased number in a range is subtler than it looks. The naive approach — take a random 32-bit integer and apply value % 6 for a die — quietly favours some faces. Because 2³² is not evenly divisible by 6, the lowest few results occur slightly more often than the highest. This is called modulo bias, and over thousands of rolls it skews the distribution.

This tool removes the bias with rejection sampling. It requests a fresh random 32-bit value and, if that value falls in the small "leftover" zone that would cause an uneven split, it throws it away and draws again. Only values from the evenly divisible portion are accepted. The cost is occasionally asking for one extra random number; the benefit is a die, coin, or range that is mathematically fair, not approximately fair.

Four generators in one

TabWhat it producesRange per item
Dice1–100 dice of d4, d6, d8, d10, d12, d20, or d1001 to the number of sides
Coins1–100 coin flips, reported as Heads/Tails2 outcomes
CardsDraws from one shuffled 52-card deckcards removed until reset
NumberIntegers in any min–max range, with optional no-duplicatesmin to max inclusive

The card deck is the one stateful generator. When you load the page or press New Deck, all 52 cards are built and shuffled with a Fisher–Yates pass driven by the same cryptographic source. Each draw removes cards from the deck, so you will never see the same card twice until you reset — exactly like dealing from a real shuffled deck.

A worked example: rolling 2d6

Set the dice tab to a count of 2 and 6 sides, then roll. Each die independently lands on 1–6, and the tool also reports the sum and the average. The two-dice sum is a classic example of why this matters: a total of 7 can be made six ways (1+6, 2+5, 3+4, 4+3, 5+2, 6+1) while a total of 2 can be made only one way (1+1). So even with perfectly fair dice, sums near 7 appear far more often than sums near 2 or 12. The fairness here applies to each individual die; the bell-shaped distribution of the sum is the mathematics of adding them, not a flaw.

The "no duplicates" option for number draws

In the Number tab, ticking No duplicates changes the algorithm entirely. Instead of drawing each value independently (where repeats are possible), it builds the full list of integers from min to max, shuffles it, and slices off as many as you asked for. This guarantees every result is distinct — perfect for a raffle where one ticket cannot win twice, or for picking unique table assignments. If you request more unique numbers than the range can supply (say, 10 unique values from 1–5), the tool refuses with an error rather than looping forever.

Practical use cases

  • Tabletop and role-playing games when you do not have physical dice — d20 systems and percentile (d100) rolls are both supported.
  • Fair decisions and tie-breakers: flip a coin, or generate one number in a range to pick a winner without anyone questioning the result.
  • Raffles and giveaways: use a unique number draw across your ticket range so each number can only be selected once.
  • Teaching probability: flip 100 coins at once and watch the heads count cluster near 50, demonstrating the law of large numbers in a single click.
  • Sampling and shuffling: draw cards to randomise an order, or pull random numbers to select rows from a dataset.

Common mistakes

  • Expecting "even" results. Fair randomness does not mean alternating or balanced — flipping ten heads in a row is unlikely but entirely possible. Each flip is independent of the last.
  • Forgetting the deck depletes. If draws stop appearing, the 52-card deck is empty; press New Deck to reshuffle.
  • Using it for security. While the underlying source is cryptographic, this is a convenience tool. For passwords or keys, use a dedicated generator.

Privacy

All randomness is generated locally in your browser through the WebCrypto API. No roll, flip, draw, or number is ever sent to a server — the results exist only on your device, and the tool works fully offline.

よくある質問

{# Alpine.js — self-hosted. (The previous jsdelivr CDN tag had a stale SRI integrity hash, so the browser refused to run it and window.Alpine was never defined — silently breaking every FAQ accordion and Alpine tool.) #}