Generate Random Relative Prime Numbers
Generate a list of random relative primes. Runs entirely in your browser, so your data never leaves your device.
Output
The result appears here as you type.
How to use Generate Random Relative Prime Numbers
- 1. Set the range. Enter Minimum value and Maximum value to bound the numbers each pair is drawn from. The generator confirms the pair shares no common factor before returning it.
- 2. Set the quantity and formatting. Enter How many pairs to control batch size, turn on Wrap in brackets to format each pair as (a, b), and set Separator for how pairs are joined.
- 3. Copy the coprime pairs. Copy the generated pairs of relatively prime numbers and paste them into a number theory worksheet, a test dataset, or a cryptography example.
When to use Generate Random Relative Prime Numbers
Generate Random Relative Prime Numbers produces pairs of coprime integers, meaning their greatest common divisor is 1, within a range you choose. Use it whenever you need sample coprime pairs for math problems or algorithm testing.
- Building a number theory worksheet. A teacher wants example pairs for a lesson on the Euclidean algorithm and coprimality, and generating several pairs saves manually checking gcd values by hand.
- Testing a GCD or Euclidean algorithm implementation. You wrote a greatest common divisor function and want confirmed coprime pairs, where the expected gcd is always 1, to check the function returns the correct result.
- Demonstrating RSA key generation concepts. You are teaching the basics of RSA cryptography, where choosing coprime numbers matters for the public exponent, and want live examples to illustrate the concept simply.
- Generating sample fractions in lowest terms. Since coprime numerator and denominator pairs cannot be simplified further, generating them gives you quick examples of fractions already in lowest terms for a math example.
Examples
Three coprime pairs from 1 to 100
Output
(14, 27) (9, 40) (51, 8)
About the Generate Random Relative Prime Numbers tool
Generate Random Relative Prime Numbers is a free online tool that works entirely inside your web browser. Generate a list of random relative primes. Because the processing happens on your own device, nothing you enter is uploaded, logged or stored anywhere.
This page is one of 120 Random utilities on EditSafely. Each one does a single job well, and all of them follow the same rule: your input stays on your machine.
You can shape the output with 5 settings, including How many pairs, Minimum value, Maximum value and Wrap in brackets, and the result refreshes the moment you change one. A worked example further down the page shows exactly what the tool produces for a real input.
Because nothing leaves your device, the tool is suitable for sensitive content such as internal documents, credentials or customer data. It also responds instantly, since every keystroke is handled on your own machine rather than by a remote API.
Frequently asked questions
Does Generate Random Relative Prime Numbers cost anything?
Yes, it is completely free. All 2,658 tools on EditSafely work without an account, a subscription or usage limits.
Does the generator send anything to a server?
No data leaves your device. The whole tool is JavaScript that runs inside your browser tab, so there is no upload, no server-side processing and no log of what you did. If you disconnect from the internet after the page loads, it keeps working.
How do I get a different result?
Run the generator again. Each run is computed fresh on your device, and any options you change are applied to the next result immediately.
Do I need to sign up or install anything?
Nothing to install and no account needed. Open the page in any up-to-date browser, including on a phone or tablet, and the tool is ready.
How do I use the result?
The output panel has a one-click copy button, and you can keep refining the input while you work; the result updates in place as you type.