Base64 to Hex Converter

Convert between Base64 and Hexadecimal formats. Decode Base64 to hex bytes or encode hex to Base64 with customizable output format.

0 characters0 bytes
0 characters0 bytes

What is Base64 to Hex Converter?

Base64 and Hex (Hexadecimal) are two common binary-to-text encoding schemes. Base64 encodes binary data using 64 characters (A-Z, a-z, 0-9, +, /) and is widely used for transmitting binary data over text-based protocols like email, HTTP, and JSON. Hex encodes each byte as two hexadecimal digits (0-9, A-F), making it ideal for inspecting raw byte values in cryptography, network protocols, and low-level debugging. Converting between these formats is essential for analyzing cryptographic hashes and tokens, debugging binary protocols, inspecting the byte content of Base64-encoded data, and working with systems that expect hexadecimal input like smart contracts or embedded systems.

How to Use

  1. Choose the conversion direction: Base64 to Hex or Hex to Base64 using the toggle buttons.
  2. Paste your Base64 or Hex string in the input field on the left.
  3. For Base64 to Hex, select your preferred hex output format (spaced, continuous, or 0x-prefixed) and case (upper or lower).
  4. Click 'Convert' to process. Copy the result from the output field using the Copy button.

Why Use This Tool?

Inspect raw byte values of Base64-encoded data in a human-readable hex format
Encode hex data to Base64 for compact transmission over text-based channels
Multiple hex output formats to match your workflow: spaced (48 65 6C), continuous (48656C), or 0x-prefixed (0x48 0x65)
Automatic input cleaning — paste hex with spaces, commas, or 0x prefixes and the tool handles it
All processing happens in your browser — your data never leaves your device

Tips & Best Practices

  • Hex output is twice the size of the raw bytes, while Base64 is only ~33% larger — use Base64 when size matters.
  • The 0x-prefixed format is commonly used in programming languages like C, Java, and Python for byte arrays and smart contract data.
  • When pasting hex input, you can use spaces, commas, or 0x prefixes — the tool will clean them automatically before conversion.
  • Use uppercase hex for readability in documentation; use lowercase for programming contexts where case conventions differ.

Frequently Asked Questions

What is the difference between Base64 and Hex encoding?

Base64 uses 64 characters to encode data, resulting in approximately 33% size increase over the original binary. Hex uses 16 characters (0-9, A-F) to represent each byte as two characters, resulting in 100% size increase. Base64 is more compact and better for data transmission, while Hex is more human-readable and better for byte-level inspection.

When should I NOT use this converter?

This converter is not suitable for: converting text to hex (use a text-to-hex tool instead); encoding data for URLs (use URL encoding); converting between character encodings like UTF-8 and ASCII; or processing very large files (browser memory limitations apply). For those use cases, use specialized tools.

What hex output formats are available?

Three formats are supported: Space-separated bytes (e.g., '48 65 6C 6C 6F'), Continuous string (e.g., '48656C6C6F'), and 0x-prefixed (e.g., '0x48 0x65 0x6C 0x6C 0x6F'). You can also toggle between uppercase and lowercase hex digits.

Can I convert Hex back to Base64?

Yes. Use the 'Hex to Base64' mode by clicking the direction toggle. Paste your hex string (with or without spaces, commas, or 0x prefixes) and click Convert. The tool will encode the hex bytes into a Base64 string.

Why would I need to convert Base64 to Hex?

Converting Base64 to Hex is useful for debugging binary protocols, inspecting the raw byte values of encoded data, analyzing cryptographic hashes or tokens, and working with systems that expect hexadecimal input like Ethereum smart contracts or embedded systems firmware.

Is this tool secure for sensitive data?

Yes. All conversion happens entirely in your browser using JavaScript. No data is sent to any server. Your input and output remain private on your device. However, be cautious when using any online tool on shared or public computers.

Real-world Examples

Inspecting a Base64-encoded JWT signature

JWT signatures are Base64-encoded. Converting to hex lets you inspect the raw bytes of the signature for debugging or comparison with expected values.

Input
c2lnbmF0dXJlX2hlcmU=
Output
73 69 67 6E 61 74 75 72 65 5F 68 65 72 65

Converting hex bytes to Base64 for API transmission

A cryptographic hash produced as hex bytes needs to be sent as Base64 in an API header. Convert the hex to Base64 for compact transmission.

Input
48 65 6C 6C 6F
Output
SGVsbG8=

Related Tools