HEX to Base64

Convert hexadecimal strings to Base64 encoding.

Convert hexadecimal bytes to Base64. Paste hex with or without spaces, colons or 0x prefixes, and get standard Base64 with padding, or tick URL-safe for the - and _ variant without padding used in JWTs and URLs. Common for hashes, keys and binary data that need to travel as compact text.

Need the reverse? Base64 to HEX

Common use cases

  • Turn a hex hash or key into Base64
  • Prepare binary data for a JSON field or a URL
  • Convert values between tools that expect different encodings

How to use

  1. Paste the hex.
  2. Tick URL-safe if needed.
  3. Copy the Base64.

FAQ

Why is Base64 shorter than hex?

Base64 packs 6 bits into each character, hex only 4, so Base64 is a third shorter.

What is URL-safe Base64?

It replaces + and / with - and _ and drops the = padding, so the result can sit in a URL or a JWT without escaping.