Skip to content
uencoder
TASK

Convert hexadecimal string to Base64 and back

Translate between hex dumps and Base64 representations of the same binary data without losing bytes or introducing padding errors.

  1. 1

    Hex and Base64 are two text representations of the same bytes. Hex uses two characters per byte (0-9a-f); Base64 packs 6 bits per character. Converting between them is a two-step decode-then-encode through the raw bytes.

  2. 2
    Hex Decoder →

    Paste the hex string (e.g. '48656c6c6f') to recover the raw bytes.

  3. 3
    Base64 Encoder →

    Feed the decoded bytes into Base64 encode to get the Base64 form ('SGVsbG8=').

  4. 4
    hex-encode → hex-decode

    Use the verify chain to confirm that hex → bytes → hex round-trips losslessly, catching any byte-order or case-sensitivity mistakes.

Frequently asked questions

Does uppercase vs lowercase hex matter?
Both 0xAB and 0xab represent the same byte. The decoder accepts either, but the encoder outputs lowercase by convention. Round-tripping preserves the value regardless of case.
Why is my Base64 output longer than the hex input?
Base64 is more compact: it uses 1.33 characters per byte versus hex's 2 characters per byte. So the Base64 form should be shorter, not longer — if it is longer, you likely encoded the hex string as text rather than decoding it to bytes first.

Workflows that solve this

Convert Ascii85 to Base64
Decode Ascii85 and re-encode as Base64 for wider compatibility.
PIPELINE
Convert Base16 to Base32
Decode hex and re-encode as Base32 for DNS-safe representation.
PIPELINE
Convert Base2048 to Base64
Decode Base2048 (emoji) and re-encode as Base64 for standard transport.
PIPELINE
Convert Base32 to Base64
Decode a Base32-encoded string into raw bytes and re-encode as Base64 for more compact representation.
PIPELINE
Convert Base32 to Hex
Decode Base32 and re-encode as hex for debugging.
PIPELINE
Convert Base58 to Base64
Decode Base58 and re-encode as Base64 for standard compatibility.
PIPELINE
Base64 encode then decode round-trip
Encode text to Base64 and decode it back to verify the round-trip preserves the original data.
PIPELINE
Convert Base64 to Hex
Decode a Base64 string into raw bytes and re-encode it as hexadecimal for inspection or interop.
PIPELINE
Convert Binary to Hex
Decode a binary (base-2) string into its byte value and re-encode as hexadecimal.
PIPELINE
Blowfish Encrypt then Base64
Blowfish encrypt then Base64-encode for text-safe transport.
PIPELINE
ChaCha20 Encrypt then Hex
ChaCha20 encrypt then hex-encode the ciphertext.
PIPELINE
DES Encrypt then Base64
DES encrypt then Base64-encode for legacy compatibility.
PIPELINE
Encode a JSON payload for URL transport
Prepare a JSON document for a URL parameter: pretty-print, Base64-encode, then percent-encode — the exact inverse of the nested-parameter decode chain.
PIPELINE
AES encrypt then Base64 encode
Encrypt plaintext with AES and encode the ciphertext as Base64 for text-safe transport.
PIPELINE
Hash content and encode as Base64
Compute a hash of the input and encode the hash digest as Base64 for compact transport.
PIPELINE
Hex encode then decode round-trip
Encode text to hexadecimal and decode it back to verify the round-trip preserves the original data.
PIPELINE
Hex-encode text and analyze
Convert text to its hexadecimal representation then compute character statistics on the hex output.
PIPELINE
Convert Hex to Base32
Decode hex and re-encode as Base32 for DNS-safe use.
PIPELINE
Convert Hex to Base64
Decode a hexadecimal string into raw bytes and re-encode it as Base64 for compact transport.
PIPELINE
HMAC Sign then Base64 Encode
Generate HMAC signature then Base64-encode for API auth headers.
PIPELINE
Morse Encode and Base64 Transport
Encode text as Morse code then Base64-encode for digital transport.
PIPELINE
Convert Multibase to Hex
Decode multibase and re-encode as plain hex.
PIPELINE
Convert Octal to Hex
Decode octal and re-encode as hex for compact representation.
PIPELINE
RC4 Encrypt then Base64
RC4 encrypt then Base64-encode for transport.
PIPELINE
Reverse text and show hex encoding
Reverse a string then inspect its hexadecimal representation — useful for debugging byte-order issues and encoding puzzles.
PIPELINE
RIPEMD-160 Hash then Base64
Compute RIPEMD-160 hash then Base64-encode for transport.
PIPELINE
SHA-512 Hash then Hex Encode
Compute SHA-512 hash then encode as hex for readability.
PIPELINE
Shuffle Text and Base64 Encode
Shuffle text characters then Base64-encode the result.
PIPELINE
Unicode Escape and Base64 Encode
Unicode-escape text then Base64-encode for ASCII-safe transport.
PIPELINE
Decode URL and show hex bytes
Percent-decode a URL-encoded string then view its hexadecimal byte representation for low-level analysis.
PIPELINE
URL Encode then Base64 Double Encode
URL-encode then Base64-encode for double encoding in API payloads.
PIPELINE
Encode a text payload for URL transport
Percent-encode text then show its hex representation for safe URL parameter transport.
PIPELINE
UUencode then Base64
UUencode text then Base64-encode the result for double encoding.
PIPELINE
Generate UUID and Base64 Encode
Generate a UUID then Base64-encode it for compact storage.
PIPELINE
XXencode then Hex
XXencode text then hex-encode the result.
PIPELINE

Learn more

Want to understand why?

Related tools