{
    "name": "Random Number Generator",
    "url": "https://calculators.geekmidst.com/calculators/random-number-generator",
    "markdown": "https://calculators.geekmidst.com/calculators/random-number-generator.md",
    "category": "Mathematics",
    "description": "Pick one or up to 1,000 random whole numbers between any two limits, with or without repeats, using your browser’s cryptographic random source.",
    "summary": "Set the lowest and highest number and how many you need. Every whole number in the range is equally likely on every draw.",
    "also_called": [
        "Random number picker",
        "RNG"
    ],
    "applies_to": "Worldwide",
    "last_updated": "2026-10-29",
    "computation": "Results are computed in the visitor’s browser on the HTML page. This API describes the calculator; it does not compute results.",
    "inputs": [
        {
            "name": "min",
            "label": "Lowest number",
            "type": "number",
            "default": "1"
        },
        {
            "name": "max",
            "label": "Highest number",
            "type": "number",
            "default": "100"
        },
        {
            "name": "count",
            "label": "How many numbers",
            "type": "number",
            "default": "1"
        },
        {
            "name": "unique",
            "label": "Allow repeats?",
            "type": "segmented",
            "default": "no",
            "options": {
                "no": "Repeats allowed",
                "yes": "No repeats"
            }
        }
    ],
    "outputs": [
        {
            "key": "numbers",
            "label": "Your random numbers",
            "format": "text"
        },
        {
            "key": "possible",
            "label": "Whole numbers in the range",
            "format": "integer"
        },
        {
            "key": "chance",
            "label": "Chance of any one number on a draw",
            "format": "percent"
        }
    ],
    "formula": {
        "text": "Number = Lowest + U, where U is a uniform random integer from 0 to (Highest − Lowest), drawn by rejection sampling from crypto.getRandomValues",
        "variables": {
            "Lowest, Highest": "the inclusive limits",
            "U": "an unbiased random offset"
        }
    },
    "worked_example": {
        "inputs": {
            "min": "1",
            "max": "100",
            "count": "1",
            "unique": "no"
        },
        "steps": [
            "There are 100 − 1 + 1 = 100 whole numbers from 1 to 100.",
            "Each is equally likely: 1 ÷ 100 = 1% per draw.",
            "A random offset from 0 to 99 is added to 1 to give the number."
        ],
        "result": "Each number from 1 to 100 has exactly a 1% chance of being picked."
    },
    "interpretation": "Use “No repeats” for raffles, seating plans or picking several winners, so nobody is drawn twice. Use “Repeats allowed” to simulate dice or independent draws.",
    "assumptions": [
        "Both limits are included and must be whole numbers between −1,000,000,000 and 1,000,000,000."
    ],
    "limitations": [
        "Numbers are generated in your browser and are not recorded, so a draw cannot be audited or reproduced later. For regulated lotteries, use an audited process."
    ],
    "rules": null,
    "faqs": [
        {
            "question": "Are these numbers really random?",
            "answer": "They come from the browser’s cryptographically secure generator (the same source used for encryption keys), and rejection sampling ensures no number in the range is favoured."
        },
        {
            "question": "Why did I get the same number twice?",
            "answer": "With repeats allowed, each draw is independent, so repeats are normal: among 23 draws from 1 to 365 there is already a better than even chance of a repeat."
        }
    ],
    "sources": [],
    "related": [
        {
            "name": "Probability Calculator",
            "url": "https://calculators.geekmidst.com/calculators/probability-calculator"
        },
        {
            "name": "Permutation and Combination Calculator",
            "url": "https://calculators.geekmidst.com/calculators/permutation-and-combination-calculator"
        },
        {
            "name": "Statistics Calculator",
            "url": "https://calculators.geekmidst.com/calculators/statistics-calculator"
        }
    ],
    "disclaimer": null,
    "publisher": "GM¹X CalcVerse"
}