Convert · Inspect · Debug

Base64 to Hex
Converter

Convert Base64 encoded strings to hexadecimal and back. Inspect individual byte values, choose output formatting, and copy results instantly all privately in your browser.

Case:
Separator: Group:
Base64 Input0 chars
Hex Output0 bytes
3
Conversion Modes
4
Separator Formats
0ms
Server Latency
100%
Private & Secure

Convert in Three Simple Steps

No sign-up, no server uploads. Paste, convert, and copy in seconds.

1

Paste Your Input

Paste a Base64 string into the input field. The tool accepts standard Base64 with or without padding whitespace is automatically stripped.

2

Choose Formatting

Select uppercase or lowercase hex, pick a separator (space, colon, dash, or none), and choose a byte grouping from individual bytes to octets.

3

Copy or Download

Copy the hex output to your clipboard in one click or download it as a .txt file. Use the Byte Inspector to drill into individual values.

A Complete Base64 ↔ Hex Toolkit

Flexible formatting, two-way conversion, and byte-level inspection in one private tool.

🔢

Flexible Hex Formatting

Choose uppercase or lowercase output, with space, colon, dash, or no separator. Group bytes by 1, 2, 4, 8, or produce a continuous hex stream.

🔄

Two-Way Conversion

Convert Base64 to hex and hex back to Base64. Accepts all common hex input formats spaced, colon-separated, dashed, or continuous.

🔍

Byte Inspector

Visualise every decoded byte with its hex value, decimal equivalent, and printable ASCII character. Instantly see how many printable vs non-printable bytes are present.

Swap Panels

One-click swap between input and output fields easily round-trip a hex string back to Base64 without switching tabs or copying manually.

🔤

Hex to Text Preview

In the Hex → Base64 tab, decode the hex bytes to readable text with one click useful for verifying that a hex string represents the ASCII content you expect.

🔒

100% Private

All conversions run locally in your browser using native JavaScript. Your data never leaves your device safe to use with hashes, keys, and binary payloads.

Base64 ↔ Hex in Action

Common conversions you can verify and copy right now.

Simple Text String

Base64 → Hex
Base64 SGVsbG8sIFdvcmxkIQ== 48 65 6C 6C 6F 2C 20 57 6F 72 6C 64 21
Decoded Text Hello, World!

MD5 Hash (Hex → Base64)

Hex → Base64
Hex (MD5) 5d41402abc4b2a76b9719d911017c592 XUFAK7xLKna5cZ2REBfFkg==

SHA-256 Digest Segment

Base64 → Hex (uppercase, colon-separated)
Base64 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= E7:DE:42:69:8F:C1:C1:49:AA:FB:F4:C8:99:6F:B9:24:27:AE:41:E4:64:9B:93:4C:A4:95:99:1B:78:52:B8:55

Binary File Magic Bytes

Base64 → Hex (file signature)
PNG header (Base64) iVBORw0KGgo= 89 50 4E 47 0D 0A 1A 0A 28 29
Meaning 89 50 4E 47 = PNG magic bytes · 0D 0A 1A 0A = CRLF + EOF marker

When You Need Base64 ↔ Hex

Hex is the native language of binary data these are the real workflows that bring the two formats together.

01

Cryptographic Hash Inspection

MD5, SHA-1, SHA-256, and other hashes are often returned as Base64 in API responses or stored in databases. Convert to hex to compare against known values in hex format.

02

File Magic Byte Detection

Identify file types by inspecting the first few bytes of a Base64-encoded file. PNG, PDF, JPEG, ZIP, and GIF all have distinctive hex signatures that reveal the true file type.

03

TLS Certificate & Key Debugging

X.509 certificates and cryptographic keys are commonly Base64-encoded (PEM format). Convert them to hex to inspect the underlying DER structure and byte layout.

04

Network Protocol Analysis

Packet payloads in tools like Wireshark are often displayed as hex. Convert Base64-encoded packet data to hex for direct comparison with captured traffic.

05

Firmware & Binary Patching

Embedded firmware or binary patches may be distributed as Base64. Convert to hex to identify offsets, instruction bytes, or patterns before applying patches.

06

Security Research & CTF

Capture-the-flag challenges frequently mix Base64 and hex encoding. Quickly convert between the two to identify hidden data, XOR keys, or shellcode sequences.

Base64 and Hex Two Views of the Same Bytes

Both Base64 and hexadecimal are encodings of binary data they represent the same underlying bytes in different text formats. Converting between them means decoding Base64 back to its raw bytes, then re-encoding those bytes as hex.

Each byte (8 bits, values 0–255) is represented as exactly two hex characters 00 through FF. Hex is therefore exactly twice as verbose per byte as the raw binary, but maps 1:1 without the 33% overhead that Base64 adds.

Hex is preferred for binary inspection because it maps directly to byte boundaries with no padding, making it easy to identify offsets, file signatures, and individual byte values at a glance.

// Base64 → Hex in JavaScript
 
function b64ToHex(b64) {
  // 1. Decode Base64 → bytes
  const raw = atob(b64);
  // 2. Map each byte → 2-char hex
  return [...raw]
    .map(c =>
      c.charCodeAt(0)
      .toString(16)
      .padStart(2, '0')
    )
    .join(' ');
}
 
// Hex → Base64 (reverse)
function hexToB64(hex) {
  const clean = hex.replace(/\s|:|−/g,'');
  const raw = clean.match(/.{2}/g)
    .map(h => String.fromCharCode(
      parseInt(h,16))).join('');
  return btoa(raw);
}

Frequently Asked Questions

Everything you need to know about Base64 and hexadecimal conversion.

Both Base64 and hexadecimal are ways to represent binary data as text. Hex uses 16 characters (0–9, A–F) and represents each byte as exactly 2 characters doubling the size. Base64 uses 64 characters and encodes every 3 bytes as 4 characters adding about 33% overhead. Hex is preferred for byte-level inspection; Base64 is more compact and widely used in data transfer.
The Hex → Base64 tab accepts all common hex formats: continuous strings (48656C6C6F), space-separated pairs (48 65 6C 6C 6F), colon-separated (48:65:6C:6C:6F), and dash-separated (48-65-6C-6C-6F). The tool strips all separators automatically before decoding. Mixed case is also accepted.
Hex represents each byte as exactly 2 characters, so a 10-byte payload produces 20 hex characters (without separators). Base64 encodes every 3 bytes as 4 characters, so the same 10 bytes produce about 16 Base64 characters. Hex is always exactly twice the byte count; Base64 is always ceiling(n/3) × 4.
File formats are identified by specific byte sequences at the start of the file called "magic bytes" or "file signatures." For example, PNG files always start with 89 50 4E 47. By converting Base64 file data to hex you can inspect these first bytes and verify the true file type even when the filename or MIME type is missing or incorrect.
Yes. Many APIs return hashes as Base64 while security tools display them as hex. Paste the Base64 hash into the converter to get the standard hex representation. A 32-byte SHA-256 hash encoded as Base64 is 44 characters; as hex it is 64 characters both represent exactly the same 32 bytes.
No. All conversion happens in your browser using JavaScript's atob(), btoa(), and toString(16) functions. Nothing is transmitted anywhere. The tool works completely offline after the initial page load safe to use with cryptographic keys, hashes, and sensitive binary payloads.
The Byte Inspector decodes your Base64 input and displays each byte as a card showing its hex value (e.g. 48), its decimal value (e.g. 72), and its printable ASCII character if it falls in the printable range 32–126 (e.g. H). Non-printable bytes show a · placeholder. The summary stats show total bytes, printable count, non-printable count, and unique byte count.