Base64 to Hex Converter
Pivot Base64 to hex and hex back to Base64 without a text detour — entirely on this device.
Case and separator shape the hex output.
Press ? for shortcuts
Do it offline:$ base64 -d encoded.txt | xxd -p
How to use it
- Paste either spelling. The badge names the detected direction — click it or press s to override — and a paste that parses both ways raises a banner offering each reading.
- Shape the hex side with its two options: lowercase or uppercase digits; none, space or colon between bytes. Base64 output is always standard alphabet, padded, one line.
- Read the chips before trusting a result: stripped data: prefixes, URL-safe letters, restored padding, 0x markers and separators are each declared there, never applied quietly.
- Copy the output, download it as .txt, or Share a link that reproduces the exact state — no server involved.
A digest, key fingerprint or wire capture is one sequence of bytes with two common spellings: Base64 and hex. This page pivots between them directly — decode, re-encode, done — never rendering the bytes as text. Paste either spelling to get the other: every accepted deviation is declared as a chip, and one byte count serves both panes. Nothing you convert leaves this device.
Examples
47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855The pivot's home case: an empty-string SHA-256 as Digest fields print it, re-spelled as the 64 hex digits a fixture expects. Same 32 bytes — nothing is hashed here.
0x48,0x69,0x21SGkhHex as C source prints it — per-byte 0x markers, commas — converts with no cleanup on your side. Both decorations become chips, and three bytes come back as four Base64 characters.
3q2-7wde ad be efURL-safe unpadded Base64 pivots straight to spaced hex: each - is read as +, the absent == is inferred from the length, and both accommodations are chipped rather than silently fixed.
Every example on this page is executed against the same engine that powers the tool, on every build.
Gotchas worth knowing
There is no text pane here
Prose bytes and random key bytes get identical treatment — nothing is ever decoded to characters, so no charset question exists and NUL-heavy payloads are first-class: AAAAAA== becomes 00 00 00 00. When the bytes are text you want to read, the Base64 decoder page does that job.
One payload, two lengths
Base64 packs three bytes into four characters; hex spends two per byte. The 32-byte digest above therefore takes 44 Base64 characters, final = included, but 64 hex digits. The gap is pure arithmetic — the printed byte count is the one figure both spellings share.
Nine tolerances, every one declared
The Base64 reader accepts data: URI headers, line wraps, URL-safe letters and absent padding, and points out a decoded byte-order mark; the hex reader absorbs 0x markers, \x escapes, separators and mixed case. Each of the nine is declared as a chip — no strict switch exists here; conformance checks belong on the decoder pages.
Some pastes are valid both ways
Spaced mixed-case pairs like De Ad 4a 5b Ca Fe Ba 8e satisfy both grammars with different answers — 8 bytes as hex, 12 as Base64 — so a banner offers both readings instead of guessing. A continuous run like deadbeefdeadbeef never triggers it: plain hex pairs outrank the Base64 alphabet.
Common errors
Invalid Base64: character '!' at position 5- The converter met a character no Base64 alphabet contains — the ! in SGVs!bG8= — and reports where it sits, counting from one. Jump to error lands the cursor there; the paste is never modified.
Odd number of hex digits — byte 2 is incomplete- Two digits form one byte, so 48 6 leaves its second byte half-written. The message numbers that incomplete byte — the usual culprit is a copy that lost its last digit.
`x` at position 3 is not a hex digit- A 0x marker only counts at the front of a pair, so in 48x9 the x is an invalid digit. Letters past f draw the same report — usually Base64 or prose, not hex.
Input is larger than the 16 MB limit for this tool. For bigger payloads use the CLI: base64 -d encoded.txt | xxd -p- At 16 MB the page refuses whole rather than converting a prefix — nothing is trimmed. The printed pipeline re-spells any size on the command line; the reverse direction is xxd -r -p hex.txt | base64.
FAQ
When do I need Base64 as hex instead of text?
Whenever the value is bytes, not words: a SHA-256 that an HTTP Digest field prints as Base64 while your fixture wants 64 hex digits, an HMAC or JWS signature to compare against a hex log line, a payload lifted from a wire capture. The bytes were never characters — re-spelling them is the entire job.
Why is the hex output longer than the Base64 input?
A Base64 character carries six bits, a hex digit four, so hex needs about half again as many characters — 64 digits versus 44 characters for the 32-byte digest example. Nothing was added; converting back shrinks it again.
Can I paste a data: URI or URL-safe Base64 here?
Yes to both. A data: prefix is cut away with a chip recording the declared MIME type; - and _ are read as their standard equivalents, chipped as well. The decoded content itself is never shown — the Base64 decoder page renders text and files, and the Base64URL decoder owns padding policies.
Does converting change the bytes?
No. The pivot decodes to bytes and re-encodes them; a round trip returns byte-identical data. A leading EF BB BF byte-order mark stays in — a chip, never a silent strip — and digit case or separators vanish on the way back. If two tools disagree, the inputs differed.
Keyboard shortcuts
- ⌘/Ctrl + Enter
- Run the conversion now (large inputs wait for this).
- ⌘/Ctrl + S
- Download the output as a .txt file (not the page).
- ⌘/Ctrl + C
- Copy the whole output when nothing is selected.
- ⌘/Ctrl + Shift + C
- Copy the output even while a selection is active.
- s
- Swap the direction (single-key; obeys the kill switch).
- t
- Switch the color theme (single-key, outside text fields).
- ? or ⌘/Ctrl + /
- Open the shortcut help overlay.
- Esc
- Dismiss the topmost overlay; the input is untouched.