Random Hex Generator

Generate random hexadecimal data by exact byte count or HEX character count, with a clear view of character length, byte equivalent, and random bits.

Length unit

Enter 1–4,096 bytes; each byte is encoded as two HEX characters.

Enter 1–200; all results together may contain at most 200,000 raw HEX characters.

Letter case
Add 0x prefix

The prefix is display-only and is not included in the data length.

Group size
Quick examples
Set the length and format, then select “Generate HEX”.
Current result Ready to generate

Current result

There is no format summary yet.
Waiting for generation
HEX characters
0
Byte equivalent
0 B
Random bit length
0 bit

Complete HEX results

Results are not numbered.
There are no HEX results yet.

Length and format details

The current length represents a whole number of complete bytes.

The 0x prefix, separators, and grouping spaces do not count toward the raw data length. Batch results are not guaranteed to be unique.

Learn more

Bytes, HEX characters, and random bits

What is the difference between bytes and HEX characters?

One byte contains 8 bits and can be written as two hexadecimal characters. For example, 16 bytes equal 32 HEX characters and 128 bits.

When generating by HEX character count, odd lengths are allowed. The final character in an odd-length value represents a half-byte (4 bits), so it is not a whole number of complete bytes.

Do the 0x prefix and grouping change the data?

No. 0x, spaces, colons, and hyphens are display formats; they do not count toward raw HEX characters, byte equivalent, or random bits. Copy and download preserve the selected display format.

How are random values generated?

The page uses Web Crypto to generate random bytes and encodes each byte as two Base16 characters. If the source is unavailable, it does not fall back to Math.random().

Limits and boundaries

One result can contain at most 4,096 bytes or 8,192 HEX characters. You can generate up to 200 results, with 200,000 raw HEX characters total.

Batch results can happen to repeat; this tool does not deduplicate them. Use a dedicated UUID generator when you need a standard UUID.

Use this tool for test data, identifier drafts, and general development. Secure tokens also depend on protocol, storage, expiry, and server-side validation.

Tool information and sources

All computation takes place in this browser. No input is uploaded, and no third-party runtime API, CDN, web font, or local storage is used.

MDN: Crypto.getRandomValues()

RFC 4648: Base16 Data Encoding

Frequently asked questions

Why do 16 bytes display as 32 HEX characters?

Each HEX character represents 4 bits and a byte contains 8 bits, so one byte requires two HEX characters.

Does the 0x prefix count toward the length?

No. It only indicates hexadecimal notation; the length counters measure the raw HEX data.

Can random HEX be used directly as a password or access token?

It provides a HEX representation of random bytes, but real security also depends on length, protocol, transport, storage, permissions, and server implementation.