Random Hexadecimal Number Generator
Generate random hexadecimal (base 16) numbers with configurable digit length
Input
Output
Readme
What is hexadecimal (base 16)?
Hexadecimal is a numeral system that uses sixteen digits: 0–9 and the letters A–F (representing values 10–15). It is one of the most widely used numeral systems in computing because each hexadecimal digit maps to exactly four binary digits (bits), making it a compact way to represent binary data. For example, the byte 11111111 in binary is simply FF in hex.
Hexadecimal is everywhere in software development. Colors in CSS are written as hex codes (#FF5733), memory addresses are displayed in hex, MAC addresses use hex pairs (00:1A:2B:3C:4D:5E), and cryptographic hashes like SHA-256 produce hex strings. Most programming languages support hex literals with a 0x prefix.
Tool description
This tool generates random hexadecimal (base 16) numbers using the digits 0–9 and letters A–F. Configure the digit length and batch size. You can optionally add the 0x prefix and toggle between uppercase and lowercase letters.
Examples
| Digits | Sample output |
|---|---|
| 2 | A7 |
| 6 | 3F8B0C |
| 8 | 7E2D9A1F |
| 8 (with prefix) | 0x7E2D9A1F |
| 8 (lowercase) | 7e2d9a1f |
Features
- Generate 1 to 1,000 random hexadecimal numbers per batch
- Configurable digit length from 1 to 256
- Optional
0xprefix for programming-ready output - Toggle between uppercase (A–F) and lowercase (a–f) letters
- One-click copy to clipboard and auto-regeneration on input change
Use cases
- Generating random hex color codes for design prototyping
- Creating test data for hex parsers, validators, and formatters
- Producing mock MAC addresses, memory dumps, or hash-like strings for development