Cryptographic Prime Number Generator
Generate large random prime numbers (8–2048 bits) using the Miller-Rabin probabilistic primality test — entirely in your browser.
Generator Settings
bits (8 – 2048)
Choose a bit length and click Generate Prime
Generating…
Decimal
Hexadecimal
Copied!
Summary
Generate large random prime numbers (8–2048 bits) using the Miller-Rabin probabilistic primality test — entirely in your browser.
How it works
- Choose a bit length between 8 and 2048 using the slider or input field.
- Select the number of Miller-Rabin rounds (more rounds = higher certainty, slower).
- Click "Generate Prime" to search for a random prime of that size.
- The result displays in decimal and hexadecimal. A confidence estimate is shown.
- Click "Copy" next to either format to copy the value to your clipboard.
- Click "Generate Again" to find a different prime of the same bit length.
Use cases
- Generate candidate primes for RSA key pairs during cryptography coursework.
- Test primality implementations against known-prime ground truth.
- Produce large primes for Diffie-Hellman key exchange prototypes.
- Explore how prime density changes across bit lengths.
- Benchmark browser BigInt performance on Miller-Rabin iterations.
- Demonstrate probabilistic primality testing to students.
Frequently Asked Questions
Last updated: 2026-06-11 ·
Reviewed by Nham Vu