Base64 Files
Hex · Base64 · Base64URL

Hex to Base64

Convert hex strings to Base64 or Base64URL instantly. Auto-detects and strips 0x prefixes, colons, spaces, and other separators — paste any hex format directly.

Converted Result

Typical Use Cases

Cryptographic Digests

HMAC-SHA256, MD5, and other hash functions output hex. Convert to Base64 for Authorization headers or JWTs.

API Signatures

Most signing algorithms (AWS SigV4, Stripe webhooks) require converting hex HMAC output to Base64 before sending.

Binary Debugging

Wireshark and tcpdump output hex captures. Convert to Base64 to embed raw bytes in API requests.

Buffer Conversion

Online equivalent of Node.js Buffer.from(hex, 'hex').toString('base64') — no code required.

Low-level Protocols

TLS handshakes, certificate fingerprints, and public key hex can be converted to Base64 for PEM or HTTPS pinning.

Color Encoding

Convert RGB hex values (e.g. #1591DC) to Base64 for specific color encoding or data compression scenarios.

How It Works

A hex string is a textual representation of binary bytes: every 2 hex characters represent 1 byte (8 bits). For example, 48 is the hex value for ASCII character H.

The conversion steps are: hex string → byte array → Base64. Base64 encodes every 3 bytes as 4 printable characters, so a 32-byte SHA-256 hash becomes 44 characters in Base64 (including one padding =).

All calculations are performed locally in your browser — no data is sent to any server.

Supported Input Formats

Plain stringMost common — Wireshark / OpenSSL default output
e3b0c44298fc1c14…
Space-separatedxxd, hexdump tool output
48 65 6c 6c 6f
Colon-separatedOpenSSL certificate fingerprint format
e3:b0:c4:42:98:fc
0x prefixC / Go / JavaScript constant format
0x48 0x65 0x6c
Comma-separatedC array / Python bytes output
48, 65, 6c, 6c

Frequently Asked Questions

What is the difference between Hex and Base64?

Hex (hexadecimal) uses 16 characters (0–9, A–F) to represent binary data — each byte requires 2 characters, making the output twice the size of the original bytes. Base64 uses 64 characters and encodes every 3 bytes as 4 characters, giving roughly 1.33× the original size. Base64 is more compact and widely used in JSON, HTML, and URL-based text protocols.

Can a SHA-256 hash be converted to Base64?

Yes. SHA-256 produces 32 bytes (256 bits) of binary data, typically represented as a 64-character hex string. Converting it to Base64 yields a 44-character string (with one padding =). Many APIs and signature verification scenarios use Base64-encoded hash values, such as HMAC-SHA256 signatures.

What is the difference between Base64URL and Base64?

Base64URL replaces + with - and / with _ from standard Base64, and removes the trailing = padding, making it safe for URL parameters, HTTP headers, and JWT tokens without additional URL encoding.

What is the 0x prefix and how does the tool handle it?

The 0x prefix is a common notation for hexadecimal numbers, originating from C, used to distinguish hex from decimal. For example, 0x48 represents decimal 72. This tool automatically detects and removes 0x prefixes, so you can paste formats like 0x48 0x65 0x6c directly.

Why does the UTF-8 output appear garbled?

If the hex data represents binary content — such as an image, hash, or encryption key — decoding it as UTF-8 text will produce unrenderable characters (shown as the replacement character �). The UTF-8 output is useful when the original hex data was produced from a text string (such as JSON or HTML).

What hex formats does the tool support?

The tool automatically detects and cleans several common formats: plain strings (e3b0c4…), space-separated (48 65 6c), colon-separated (e3:b0:c4), comma-separated (48,65,6c), and 0x-prefixed (0x48 0x65) values. No manual pre-processing needed — just paste and convert.