araç köşesi

Base64 to Hex (and Hex to Base64)

Convert a Base64 or base64url string to hex byte by byte, or a hex string to Base64

Your data stays with you. Conversion happens inside the browser; nothing is sent to a server.

How it works

Paste a Base64 string into the left pane; with Direction set to Base64 → Hex, the hex form of the bytes appears on the right. SGk= is two bytes and shows as 4869, and the result line reads "2 bytes · 16 bits". Type 4869 and switch to Hex → Base64 and you get SGk= back. JWT segments and base64url strings in URLs use - and _ and drop the trailing = padding; the tool recognises both without any extra setting. On the hex side, spaces, colons, commas and 0x prefixes are stripped, so 0x48, 0x69 and 48:69 give the same result. When you need to compare the Base64 form of a signature, a key or a SHA-256 hash with its hex form, this tool shows the raw bytes without trying to read them as text. A character outside the alphabet or an odd number of hex digits is reported with its position. Everything is processed in your browser.

This tool is also known as base64 to hex, hex to base64, base64 to hex converter, base64url to hex, convert base64 to hex.

What is Base64?

Base64 is the standard way to write binary data with letters, digits and two symbols only (RFC 4648). Three bytes, or 24 bits, are cut into four 6-bit pieces, and each piece maps to one character of a 64-character alphabet. The result is about a third longer than the data. Email attachments, files embedded in JSON, certificates and API signatures are usually carried as Base64.

What is Hex (hexadecimal)?

Hex writes every byte as exactly two characters from 0-9 and a-f: the byte 0 becomes 00, the byte 255 becomes ff. It is longer than Base64 (two characters per byte) but easier to read, because every byte stands on its own and can be counted. Hash values, MAC addresses, colour codes and debugging output are written in hex for that reason.

What is the difference between Base64 and hex?

Both put the same bytes into plain text; they differ in density. Hex uses two characters per byte, so a 32-byte hash is 64 characters. Base64 writes three bytes as four characters, so the same hash takes 44. Hex is easier to read and compare because each byte stands alone, while Base64 saves space and is preferred in JSON, email and URLs. To compare two spellings of the same value, convert both to the same form first.

Why Base64 to hex rather than Base64 to text?

Base64 carries the bytes of a file, a signature or a key, and those bytes are usually not readable text. A text decoder turns them into odd symbols or � characters, and you lose track of which byte is which. Hex shows every byte as two digits with no interpretation at all: a 32-byte HMAC-SHA256 signature is exactly 64 hex digits.

That makes hex the safest common ground when you compare a webhook signature, a certificate fingerprint or a checksum between two systems. If one side gives you Base64 (a SHA-256 hash is 44 characters) and the other gives hex (64 digits), this tool brings both into the same form.

base64url and padding: one value, two spellings

In standard Base64, + and / have special meanings in URLs and = separates values in a query string. That is why JWT, OAuth and many APIs use base64url: - replaces +, _ replaces /, and the trailing = padding is dropped. Both spellings carry the same bytes; SGk= and SGk are the same two bytes.

For Hex → Base64, choose the variant by where the value will go: standard for a JSON field or an email, base64url for a URL or a JWT. The receiving side documents which one it expects, and the wrong variant usually comes back as an "invalid character" or "signature mismatch" error.

Frequently asked questions

How do I convert Base64 to hex?

Paste the Base64 string into the left pane; with the direction set to Base64 → Hex, the hex result appears immediately. Each byte is two hex digits, so the hex is twice as long as the byte count. Pick spaced or uppercase output under Hex style.

How many bytes is a Base64 string?

Every 4 Base64 characters are 3 bytes, and each = at the end removes one byte. A 44-character string ending in a single = is 32 bytes, which is the size of a SHA-256 hash. The tool prints the byte and bit count on the result line.

How do I see a JWT signature in hex?

A JWT has three parts separated by dots, and the signature is the last one. Copy what comes after the last dot and paste it. The signature is base64url (it uses - and _ and has no padding); the tool recognises that on its own and shows the bytes in hex.

Is the key or signature I paste sent anywhere?

No. The conversion runs in your browser, and the tool code on this page is not allowed to make network requests. On a shared computer, still clear secret keys from the clipboard when you are done.