Developer Utilities

Base64 ↔ Hex / Binary

All tools

See the actual bytes behind a Base64 string as hex or binary, or go the other way.

How it works

Four simple steps

1

Pick a mode

Base64 to hex or binary, or hex or binary back to Base64.

2

Paste the input

Separators in hex and binary input are ignored; 0x prefixes are not.

3

Read the bytes

Hex appears as a continuous string, binary as spaced 8-bit groups.

4

Copy the output

Copy it for comparison or download converted.txt.

Base64 ↔ Hex / Binary

About Base64 ↔ Hex / Binary

One system logs a SHA-256 digest as hex, another stores it as Base64, and you need to know whether they hold the same value. Converting by eye is hopeless. This tool turns one representation into the other so you can compare them directly.

Choose one of four modes: Base64 to hex, hex to Base64, Base64 to binary, or binary to Base64. Hex output is lowercase with no separators, and binary output shows each byte as eight bits separated by spaces. On the way in, hex input skips anything that is not a hex digit, so spaces and colons from debuggers are fine, but remove 0x prefixes, because their 0 is counted as a digit. An odd number of digits is rejected. Binary input keeps only 0s and 1s and must add up to whole bytes. Base64 input must use the standard alphabet.

Hex is the quickest way to recognise a file type or protocol. Bytes starting 89 50 4e 47 are a PNG, 1f 8b is gzip, and 7b is the opening brace of a JSON document. When the bytes turn out to be Protobuf, MessagePack or CBOR, decode the binary payload for a structured view. For single numbers rather than byte strings, the number base converter handles decimal, hex and binary values.

Conversion uses typed arrays in your browser, so digests and key material never leave the page.

Keyboard shortcut

Ctrl Enter - Run tool
FAQ

Frequently asked questions

See all FAQs

Answers for this tool. For site-wide help, open the FAQ hub.

Every byte needs exactly two hex digits. The usual causes are a missing leading zero, a truncated copy, or a 0x prefix whose 0 is counted as a digit. Remove the prefix and check the final characters.

Not directly, since - and _ are not in the standard alphabet. Convert the string to standard Base64 first, then come back and pick a mode.

Hex maps each byte to exactly two characters, so values line up by position and it is easy to see where they differ. Base64 packs three bytes into four characters, which hides byte boundaries.

View more FAQs

Related tools

View all

Cron Calendar

Explain cron expressions and preview the next run times in any timezone.

Open

CSV to SQL

Infer column types and generate CREATE TABLE + INSERT statements from CSV.

Open

SQL Query Builder

Build SELECT queries visually and reverse-parse SQL into a structure tree.

Open

Log Pattern Miner

Cluster log lines into templates, surface anomalies, and mask PII locally.

Open

Explore 321 free tools

Everything you need as a developer, marketer or creator - in one beautiful place.

Browse all tools