Skip to main content

Hex to Base64 Converter

API reference

Convert hexadecimal bytes to Base64, or Base64 back to hex. Accepts 0x / \x / spaced / colon-separated hex, standard and URL-safe Base64, with optional padding and MIME line wrapping.

Input

Output

Result
Was this helpful?

More ways to use this tool

REST API

curl -X POST https://api.iotools.cloud/v1/tool/hex-to-base64-converter \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "hexToBase64",
    "inputText": "48656c6c6f2c20576f726c6421"
  }'

Swap in your own key from your account. The tool's fields are the body — no wrapper.

Ask an AI agent

Use the IOTools `hex-to-base64-converter` tool (Hex to Base64 Converter) on this input:

YOUR_INPUT_HERE

Paste this at any agent connected to the IOTools MCP server, then add your input.

Embed widget

<iframe
  src="https://iotools.cloud/embed/hex-to-base64-converter/"
  width="100%" height="520" frameborder="0" scrolling="no" loading="lazy"
  title="Hex to Base64 Converter — iotools.cloud"
  sandbox="allow-scripts allow-forms allow-same-origin allow-downloads allow-popups allow-popups-to-escape-sandbox"
  allow="clipboard-write"
  style="width:100%;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden"></iframe>
<script src="https://iotools.cloud/embed.js" async></script>

Drop this into your own page — free, no key required, just a link back.

Cost per API/MCP callFrom 5 credits
Need more credits?View pricing

Also available with

Guides

Hexadecimal and Base64 are two ways of writing the same raw bytes. Hex is easy to read byte by byte (checksums, hashes, packet dumps), while Base64 is about a third shorter and safe to paste into JSON, URLs, HTTP headers and data URIs. This converter moves between them directly, with no text decoding in the way.

How to use it

  1. Pick a direction: Hex to Base64, or Base64 to Hex.
  2. Paste your input. Hex can be written as 48656c6c6f, 48 65 6c 6c 6f, 48:65:6c:6c:6f, 0x48 0x65 or \x48\x65. Base64 can be the standard or URL-safe alphabet, with or without = padding.
  3. Set the output options. For Base64: URL-safe alphabet, padding, and optional 76-column MIME wrapping. For hex: separator and letter case.
  4. Copy or download the result.

Good to know

  • This works on bytes, not text. 48656c6c6f becomes SGVsbG8=, the Base64 of the five bytes. To encode a string such as "café" first, use the Hex to Text Converter or Text to Base64.
  • The URL-safe alphabet swaps + and / for - and _, and is what JWTs and many APIs use. Padding is usually dropped there.
  • A hex input needs an even number of digits, and a Base64 input cannot have a single dangling character; the field shows a clear error instead of guessing.
  • Everything runs in your browser. Nothing is uploaded, so it is safe for keys, hashes and tokens.

Examples

Hex Base64
48656c6c6f SGVsbG8=
deadbeef 3q2+7w==
fbfffe +//+ (standard) / -__- (URL-safe)
hexbase64base64urlbytesbinaryencodedecodehashdeveloper

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.