Hexadecimal to Base64 Converter

Paste a hexadecimal string and instantly get the Base64-encoded result.

Use the Hexadecimal to Base64 Converter

Hexadecimal Input

Base64 Output

Copied!

Summary

This tool converts a hexadecimal (hex) string into its Base64-encoded representation entirely in your browser. It supports standard Base64 (RFC 4648) and URL-safe Base64, and also performs the reverse conversion from Base64 back to hex. No data is sent to any server.

How it works

  1. Choose a direction: Hex to Base64, or Base64 to Hex.
  2. Paste or type your input into the input field.
  3. Spaces and optional 0x prefixes in hex input are stripped automatically.
  4. Each two-character hex pair is decoded into a raw byte, then Base64-encoded.
  5. Toggle "URL-safe" to replace + with - and / with _ in the Base64 output.
  6. Click Copy to copy the result to your clipboard.

Use cases

  • Convert cryptographic keys or hashes stored in hex to Base64 for JWT or PEM formats.
  • Encode hex-encoded binary data for embedding in JSON or XML.
  • Verify that a Base64 value matches a known hex representation.
  • Prepare hex color or binary values for Base64-encoded data URIs.
  • Generate URL-safe Base64 tokens from hex-encoded random bytes.
  • Convert hex-encoded SHA/MD5 digests to the Base64 form many APIs expect.
  • Reverse-decode a Base64 string back to its raw hex representation for debugging.

Frequently Asked Questions

Last updated: 2026-05-28 · Reviewed by Nham Vu