About this tool
Decode Base64 into hexadecimal byte output locally.
Base64 to Hex decodes a Base64 string into its raw bytes and prints those bytes as hexadecimal — two hex digits per byte, so the output is always exactly twice the decoded length. It reads the standard RFC 4648 §4 alphabet as well as URL-safe input using - and _, and can render the result spaced, continuous, as a C array or as a hexdump -C listing with 16 bytes per line and a printable-ASCII gutter. It is for engineers inspecting a binary blob that arrived as text.
Open Base64 to Hex on AltFTool — it loads instantly in your browser.
Put your payload in the 'Base64 Input' box — type it, press Paste, press Upload .txt (it accepts .txt, .b64 and .base64), drag a file onto the box, or press Sample Data for a ready-made example. The character count sits under the box and Clear empties it.
Auto Convert is ON by default, so the 'Hex Output' panel fills in as you type; switch it off and press Convert to run it by hand. Bad input turns the status pill to Invalid and prints the reason, such as 'Incorrect length — this is not valid Base64.'
Shape the bytes in Advanced Options — 'Uppercase Hex (A-F)', 'Add 0x prefix', 'Group hex pairs' and the grouping menu (No grouping, Pairs (2 chars), Words (4 chars), Blocks (8 chars)) — then press Copy, Download .txt to save base64-to-hex.txt, or Share; Reset clears the input and restores the default options.
Every byte becomes two hex digits, so the output length confirms the decoded size at a glance.
Offsets are 8 hex digits, 16 bytes per line in two groups of 8, matching hexdump -C output.
A stray character is reported with its position; a 4n+1 length is flagged as truncation.
Exactly 2 per decoded byte. Base64 turns 4 characters into 3 bytes, so 100 Base64 characters become 75 bytes and 150 hex digits. The tool reports both counts so you can verify a payload length without a hex editor.
Read the first bytes in hex. 89 50 4E 47 is PNG, FF D8 FF is JPEG, 25 50 44 46 is %PDF, 50 4B 03 04 is a ZIP (so also .docx or .xlsx), and 1F 8B is gzip. The tool shows the first 8 bytes separately for exactly this check.
Yes. URL-safe Base64 (RFC 4648 §5) swaps + for - and / for _, and usually drops the = padding. Both alphabets decode here, and the tool notes when it accepted an unpadded string.
The most common cause is truncation: a Base64 length of 4n+1 characters cannot exist, because 4 characters carry 3 bytes. The other frequent causes are a stray character copied from a wrapped email header, or `=` padding appearing somewhere other than the end.
Add the Base64 to Hex widget to your blog or website — free, responsive, no signup. Just keep the “Widget by AltFTool” credit link visible.
<iframe src="https://www.altftool.com/embed/widget/base64-to-hex"
title="Base64 to Hex — free AltFTool widget"
width="100%" height="640" style="border:0;border-radius:12px;overflow:hidden"
loading="lazy" referrerpolicy="no-referrer-when-downgrade" allow="clipboard-write"></iframe>
<p style="font-size:12px;margin:4px 0 0">Widget by <a href="https://www.altftool.com/tools/all/base64-to-hex?utm_source=embed&utm_medium=widget" rel="nofollow">AltFTool — free online tools</a></p>