工具 指南
娱乐 免费 无需注册

骰子投掷器(RPG版)

使用2d6+1d8+5等标准表示法投掷多面体RPG骰子。

正在加载工具…

关于此工具

功能完整的桌游RPG骰子投掷器,支持d4、d6、d8、d10、d12、d20和d100。输入任意表示法(如「2d6+1d8+5」),选择优势或劣势,查看单个骰子结果和总计。使用WebCrypto保证真随机性,并保存最近10次投掷的历史记录。

使用方法

  1. 1 第一步:在输入字段中输入骰子表示法(如「3d6+2」或「1d20+1d4+3」),或使用快速投掷按钮。
  2. 2 第二步:可选择为单个骰子选择「优势」(投两次取较高值)或「劣势」(取较低值)。
  3. 3 第三步:点击「投掷」——单个骰子面和总计立即显示。
  4. 4 第四步:在结果面板下方查看投掷历史记录。随着新投掷的添加,旧条目逐渐淡出。

How dice notation works

Tabletop games describe rolls with a compact shorthand called dice notation, and this roller speaks it fluently. The core pattern is NdS: roll N dice that each have S sides. So 1d20 means one twenty-sided die, 3d6 means three six-sided dice summed together. You can chain groups and add a flat bonus with + or -, which is how a Dungeons & Dragons attack often looks: 2d6+1d8+5 rolls two d6s, one d8, and adds 5 to the total. The roller parses each segment independently, rolls every die, sums the kept values, applies the modifier, and shows you both the grand total and a per-group breakdown so you can verify the math.

The tool supports the seven standard polyhedral dice — d4, d6, d8, d10, d12, d20, and d100 — and renders each as its correct geometric shape (a triangle for the d4, a pentagon-ish trapezoid for the d10, a circle for the percentile d100) with the rolled number printed on its face.

True randomness, not Math.random

A dice roller is only fair if its randomness is genuinely unpredictable. This tool does not use JavaScript's ordinary Math.random(), which is fast but not designed to be unbiased or unguessable. Instead it draws from the browser's Web Crypto API via crypto.getRandomValues(), the same cryptographically secure source used for security tokens. Each die roll pulls a fresh 32-bit random integer and maps it onto the die's faces. The result is that every face has an essentially equal chance, and no sequence of past rolls lets anyone predict the next — which is exactly what you want when a critical hit is on the line.

Advantage, disadvantage, and "keep highest"

Modern RPGs add two twists this roller handles natively. Advantage rolls the die twice and keeps the higher result; disadvantage keeps the lower. Select the mode from the dropdown and it applies to your first die group — the display shows both numbers, with the discarded one greyed out, plus an annotation like (advantage: 17 vs 4).

Separately, the notation itself supports a "keep" suffix written NdSkX: roll N dice and keep the best X. The classic use is ability-score generation, 4d6k3 — roll four six-sided dice and keep the highest three, dropping the lowest. There's a quick-roll button for exactly this. The dropped die still appears in the result, dimmed, so you can see what was discarded.

A worked example

Enter 4d6k3 and roll. Suppose the four dice land on 5, 2, 6, and 4. The roller sorts them, keeps the top three (6, 5, 4), and drops the 2. The breakdown reads 4d6k3 = +15 and the total is 15 — a solid ability score. The discarded 2 shows greyed out among the dice. Now try a combat roll: type 2d6+1d8+5. If the d6s give 3 and 5, the d8 gives 6, the math is 3 + 5 + 6 + 5 = 19, and the breakdown shows each group's contribution separately so you can audit it instantly.

Common use cases

  • Lost or scattered physical dice. When your dice bag is at home or a die rolled under the couch, this is an instant replacement.
  • Online and remote play. Playing over voice or video chat, where everyone needs a trusted shared roller that no one can fudge.
  • Character creation. The 4d6k3 method for generating ability scores, repeated six times.
  • Complex damage rolls. A spell or weapon that combines several dice plus a modifier in one expression.
  • Board games and probability demos. Anywhere you need a quick, fair random number within a known range.

Tips and common mistakes

  • The keep suffix lowercases. Notation is case-insensitive and whitespace is stripped, so 2D6 + 5 and 2d6+5 are identical — but the keep marker must be a lowercase-style k followed by a number, as in 4d6k3.
  • Advantage hits the first group only. If you write a multi-group expression with advantage selected, the higher-of-two reroll applies to the first die in the first group, matching how the rule normally works for a single d20 attack.
  • Watch the breakdown, not just the total. The per-group line is there so you can confirm the roller did what you meant — a quick sanity check that catches a mistyped notation.
  • Use the quick buttons. One tap gives you a single d4 through d100, plus presets for "4d6 drop lowest" and "2d20 (adv)," which is faster than typing for common rolls.
  • History is short-lived. The last 10 rolls are listed for reference, but they live only in the current page session — refresh and they're gone, so jot down anything you need to keep.

常见问题

{# 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.) #}