Base64 to Hex Converter

Convert standard, URL-safe Base64 strings, or MIME Data URIs into formatted hexadecimal byte representations with custom delimiters, case toggles, and byte metrics.

How to Convert Base64 to Hexadecimal Online

1

Paste Base64 Payload

Enter your standard Base64 string, URL-safe Base64 token, or MIME Data URI into the editor.

2

Live Formatting & Delimiters

Choose your preferred byte delimiter (space, colon, comma, none), prefix (0x, \x), and casing. The tool converts in real time.

3

Copy & Export Hex

Inspect byte metrics, copy the formatted hex string directly to your clipboard, or download it as a text file.

Tool Options

Configurable Byte Delimiters

Format hex bytes with spaces, colons, hyphens, or commas for Wireshark, binary inspection, or C array pasting.

Data URI & URL-Safe Support

Automatically detects and handles data:image/*;base64 schemes and URL-safe -_ alphabet characters.

Byte & Bit Metric Inspector

Calculates exact binary length metrics in bytes and bits, confirming alignment and buffer payload dimensions.

Your Data Privacy

Web Tool
Privacy-First Architecture
Most of our web tools process your data entirely in-browser. Where server processing is technically required, payloads are evaluated statelessly in-memory and are never stored, saved, or logged.
REST API
Stateless In-Memory Processing
When you use our API endpoints, your requests are processed strictly in-memory without persistent database storage, disk logging, or data retention.
Want to learn more about how we safeguard your information and infrastructure?
Read our full Privacy Policy for detailed security standards, data retention principles, and compliance guarantees.

What does the Base64 to Hex Converter do?

The Base64 to Hex Converter decodes standard Base64, URL-safe Base64 (base64url), and MIME Data URIs into formatted hexadecimal byte streams. It allows network engineers, security analysts, and backend developers to inspect binary memory layouts, analyze cryptographic key material, format byte payloads for C/Rust structs, and parse network packets without running manual shell scripts.

Core Concepts

  • Binary-to-Text Transcoding: Standard Base64 (RFC 4648 §4) represents every 3 raw bytes (24 bits) as 4 ASCII characters (6 bits each). Hexadecimal (Base16, RFC 4648 §8) encodes each byte (8 bits) as 2 hexadecimal characters (00 to FF).
  • URL-Safe Normalization: Standard Base64 uses + and / characters with = padding. URL-safe Base64 replaces them with - and _ and frequently omits trailing padding. This converter normalizes URL-safe representations back to standard Base64 before byte decoding.
  • Data URI Stripping: Data URIs (e.g. data:image/png;base64,iVBORw...) include metadata headers. The parser automatically extracts the raw Base64 payload prior to hexadecimal conversion.

How to use the tool?

  1. Paste Base64 String: Input your Base64 payload, JWT signature segment, cryptographic key string, or Data URI into the editor or click Sample.
  2. Configure Delimiter & Formatting: Select between Space (48 65 6c), None (48656c), Colon (48:65:6c), Dash (48-65-6c), or Comma (48, 65, 6c), optional prefix (0x, \x), and lowercase/uppercase casing.
  3. Live Conversion & Export: The tool converts instantly in real time. Click Copy or Download to export the hexadecimal output.

Related Developer Utilities

  • Base64 Encoder: Encode raw UTF-8 text strings to standard and URL-safe Base64.
  • Base64 Decoder: Decode Base64 payloads back to UTF-8 text or formatted JSON.
  • Base64 to Base64URL: Convert standard RFC 4648 Base64 strings to URL-safe Base64 format.
  • Base64URL to Base64: Restore padding and standard Base64 characters from URL-safe strings.

REST API Integration

blueutils.com provides a free REST API endpoint (POST https://blueutils.com/api/base64/base64-to-hex) for programmatic integration into CI/CD pipelines, build systems, and autonomous agent workflows.

API Request Parameters

Name Type Description Example
rawText String / Object Raw Base64 string, URL-safe Base64, or Data URI (aliases: text, payload, data, input, value). "SGVsbG8="
delimiter String Optional separator between hex bytes ("", " ", ":", "-", ", "). Default is " ". " "
prefix String Optional prefix for each byte ("", "0x", "\\x"). Default is "". "0x"
caseFormat String Casing for hex characters ("lower" or "upper"). Default is "lower". "upper"

API Request Payload Examples

cURL

curl -X POST https://blueutils.com/api/base64/base64-to-hex \
  -H "Content-Type: application/json" \
  -d '{ "rawText": "SGVsbG8gQmx1ZXV0aWxzIQ==", "delimiter": " ", "caseFormat": "upper" }'

Python

import requests

url = "https://blueutils.com/api/base64/base64-to-hex"
payload = {
    "rawText": "SGVsbG8gQmx1ZXV0aWxzIQ==",
    "delimiter": " ",
    "caseFormat": "upper"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())

Java

import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Main {
    public static void main(String[] args) throws Exception {
        String jsonPayload = "{\"rawText\": \"SGVsbG8gQmx1ZXV0aWxzIQ==\", \"delimiter\": \" \", \"caseFormat\": \"upper\"}";
        HttpClient client = HttpClient.newHttpClient();
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://blueutils.com/api/base64/base64-to-hex"))
            .header("Content-Type", "application/json")
            .POST(HttpRequest.BodyPublishers.ofString(jsonPayload))
            .build();
        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.body());
    }
}

API Response Parameters

Name Type Description Example
isValid Boolean Indicates whether Base64 parsing and hex conversion succeeded. true
result String Formatted hexadecimal output string. "48 65 6C 6C 6F"
rawHex String Continuous unformatted hexadecimal string. "48656c6c6f"
byteLength Number Total decoded binary payload length in bytes. 5
bitLength Number Total decoded binary length in bits. 40

API Response Payload Examples

Success Response (HTTP 200 OK)

{
  "isValid": true,
  "result": "48 65 6C 6C 6F 20 42 6C 75 65 75 74 69 6C 73 21",
  "rawHex": "48656C6C6F20426C75657574696C7321",
  "byteLength": 16,
  "bitLength": 128,
  "delimiter": " ",
  "prefix": "",
  "caseFormat": "upper"
}

Validation Failure Response (HTTP 400 Bad Request)

{
  "isValid": false,
  "error": "Invalid Base64 format: String contains non-Base64 characters or invalid padding length."
}

Rate Limit Exceeded Response (HTTP 429 Too Many Requests)

{
  "error": "API rate limit exceeded. Please wait or contact support@blueutils.com."
}

Why use an API to convert Base64 to Hex?

Integrating the Base64 to Hex API into automated build pipelines and microservice architectures provides distinct advantages:

  • Automated Binary Asset Verification: Verify binary file signatures, firmware payloads, and compiled artifacts directly within CI/CD release verification jobs.
  • Optimized Token Efficiency for AI Agents: AI coding agents frequently struggle with raw binary bit shifts and hex decoding. Offloading Base64-to-Hex conversions saves hundreds of prompt tokens per interaction.
  • Deterministic Accuracy Without Hallucinations: Cryptographic keys, authorization tokens, and hashes require byte-for-byte exactness. Blueutils executes native buffer transformations to guarantee 100% precision.

Native Usage

Perform Base64 to Hexadecimal conversions locally without external dependencies using native OS tools:

Windows (PowerShell)

# Convert Base64 string to Hex in PowerShell
$b64 = "SGVsbG8="
$bytes = [System.Convert]::FromBase64String($b64)
$hex = [System.BitConverter]::ToString($bytes) -replace '-'
Write-Output $hex

Linux / Unix (Bash)

# Convert Base64 string to Hex using xxd or od
echo -n "SGVsbG8=" | base64 -d | xxd -p

Python

import base64

b64_str = "SGVsbG8="
raw_bytes = base64.b64decode(b64_str)
hex_str = raw_bytes.hex()
print(hex_str)

Java

import java.util.Base64;
import java.util.HexFormat;

public class Base64Hex {
    public static void main(String[] args) {
        String b64 = "SGVsbG8=";
        byte[] bytes = Base64.getDecoder().decode(b64);
        String hex = HexFormat.of().formatHex(bytes);
        System.out.println(hex);
    }
}

Frequently Asked Questions (FAQ)

How do I convert Base64 to Hex online?

Paste your standard or URL-safe Base64 string into the editor, select your preferred byte separator (space, colon, none) and case, then click Convert to Hex.

Does the converter support Data URIs and URL-safe Base64?

Yes. The tool automatically detects and strips data:image/*;base64 headers and normalizes URL-safe -_ characters before decoding.

Is my Base64 payload securely processed?

Yes. All Base64 decoding and hexadecimal byte formatting execute entirely in your browser without uploading payloads to remote servers.

Rate Limits

UI Limits
100 uses per 15 minutes
Max payload size: 5 MB
API Limits
5 requests per 60 minutes
Max payload size: 256 KB
Need higher API rate limits, increased payload sizes, or custom developer solutions?
Contact our engineering team at support@blueutils.com for custom rate limit increases, higher quota allocations, or tailored enterprise integrations.