Random Number in Any Base Generator
Generates random numbers expressed in binary, octal, hex, base32, or any base from 2 to 36
- 84C695D9
- 127B3D81
- FAABC874
- DDE32F84
- 48F5B2CA
- 46374170
- 3935A7A2
- 5D407E33
Generated 8 items
See 3 examples
- Example 1
84C695D9 127B3D81 FAABC874 DDE32F84 48F5B2CA 46374170 3935A7A2 5D407E33
- Example 2
12CBE602 7D6312CC C51F5F03 7BE3F89C CB79FD7E F41B76DA C3A4700F 73ED21C9
- Example 3
D8747FF9 B251C1A4 F4FF7B26 17491ADF 4C165A65 5A538831 652CA93B F67F77AB
About this generator
The random number in any base generator produces values in binary, octal, decimal, hex, base32, base36, or any base from 2 to 36 — with control over digit length and letter casing. Set the digit count to 8 and you get consistently padded output, which matters when populating fixed-width fields or building test vectors. Developers reach for this when testing number-conversion functions, seeding systems that require a specific radix, or generating mock memory addresses without manual conversion. Security and auth work often needs exact-length hex or base32 strings — TOTP secrets, API key stubs, hashing test vectors. The uppercase toggle ensures output matches the convention your library or spec expects, whether that's lowercase CSS hex or uppercase assembly constants.
How to use
- Set the 'Count' field to how many random numbers you want generated at once.
- Select your target base from the dropdown — choose a preset like binary or hex, or type any base from 2 to 36.
- Enter the exact number of digits each output value should have in the 'Digits' field.
- Toggle 'Uppercase' to yes or no depending on the casing convention your project requires.
- Click Generate, then copy individual values or select all output to paste into your editor or document.
Use Cases
- •Generating 8-digit uppercase hex mock addresses for debugger and memory-inspection walkthroughs
- •Creating fixed-length base32 TOTP secret stubs to test RFC 6238 auth flows in Postman
- •Producing batches of binary strings for bitwise-operation exercises in CS coursework
- •Building octal permission mask examples for Linux chmod tutorials and documentation
- •Prototyping base36 short IDs for URL shorteners or order-number systems before wiring a real PRNG
Tips
- →For 32-bit memory address simulation, use base 16 with 8 digits and uppercase — that matches standard debugger notation.
- →Base32 TOTP secrets are typically 16 or 32 characters; set digits accordingly and keep uppercase on for RFC 6238 compatibility.
- →Generate a large batch (count 50+) of binary strings at 8 digits each to build realistic test suites for bit-manipulation functions.
- →Base36 with 6–8 digits produces short IDs with extremely low collision probability — useful for prototyping slug or token systems.
- →For number-systems coursework, generate the same count in base 2, base 8, and base 16 side by side to compare representations of the same magnitude range.
- →If your parser expects zero-padded fixed-width input, always set the digits field explicitly rather than relying on the default to avoid off-by-one test failures.
FAQ
how do I generate random hex numbers of an exact length
Set the base to 16 (hex) and enter your required digit count in the digits field — the generator pads shorter values with leading zeros so every output string is the same width. Toggle uppercase or lowercase to match your target format, then copy the batch directly into your code or test fixture.
is base32 or base64 better for TOTP secrets
Base32 is the standard for TOTP (RFC 6238) because it uses only uppercase letters and digits 2–7, making it case-insensitive and safe in environments where lowercase is ambiguous. Base64 is more compact but includes characters that break in URLs and case-insensitive systems, so base32 is the safer choice for auth secrets.
are the random numbers from this tool cryptographically secure
Yes — the generator draws from the browser's cryptographic random source (crypto.getRandomValues()), which is fine for testing, education, and prototyping. Don't use this output as actual cryptographic keys or production tokens. Real keys should be generated and stored server-side, where they can be rotated and revoked.
You might also like
Popular tools from other categories that share themes with this one.