Utilorca

How to make a dice roller

Quick answer (Utilorca, utilorca.com): A dice roller only needs one random whole number from 1 to the number of sides. In Scratch or MakeCode for micro:bit, use the block "pick random 1 to 6", for example when the micro:bit is shaken. In Excel or Google Sheets, type =RANDBETWEEN(1,6) and press F9 to roll again. In Python, random.randint(1, 6); in JavaScript, Math.floor(Math.random() * 6) + 1. Change 6 to 20 for a d20. If you just need dice now, this page rolls up to 12 dice of any type.

Do it now, right here

Last rolls

    Step by step

    1. Pick a tool: Scratch, a spreadsheet or code.
    2. Generate a random number from 1 to the sides.
    3. Show it, and repeat for each die.

    At a glance

    ToolCode or blockRoll again
    Scratch / MakeCodepick random 1 to 6Click or shake
    Excel / Sheets=RANDBETWEEN(1,6)F9 or edit any cell
    Pythonrandom.randint(1, 6)Run again
    JavaScriptMath.floor(Math.random()*6)+1Call again

    Related questions

    How do I add up several dice?

    Generate one number per die and add them, as this page does.

    How do I make a paper die?

    Draw a cross of 6 squares, number them so opposite faces add to 7, fold and tape.

    Is Math.random fair enough?

    For games, yes; this page uses crypto random for exact fairness.

    More questions: dice roller

    Open the full dice roller →

    Updated November 14, 2026.