Base64 to Hex Converter
Convert canonical padded RFC 4648 Base64 into exact lowercase hexadecimal bytes or turn strict hexadecimal bytes back into Base64.
Privacy: your files never leave your device. All processing happens locally in your browser.
How to use
- 1.Choose Base64 to hexadecimal or hexadecimal to Base64 and identify the exact source encoding profile.
- 2.Paste canonical padded Base64 without whitespace, or hex with exactly two digits per byte and no prefix or separators.
- 3.Run the conversion, verify the expected byte length and leading zeros, then copy the exact result.
About Base64 to Hex Converter
Base64 to Hex Converter translates the same byte sequence between RFC 4648 Base64 and Base16 hexadecimal. Choose a direction, paste one representation, run the conversion, and copy the exact output. The page performs byte-level conversion locally and does not upload the input. It is intended for inspecting encoded payloads, protocol fields, test fixtures, hashes, binary identifiers, and small data samples.
Base64 represents each group of three input bytes as four characters selected from uppercase letters, lowercase letters, digits, plus, and slash. When the final group has only one or two bytes, equals signs complete the four-character group. Hexadecimal represents each byte with exactly two digits. This tool emits lowercase hex for compact consistency and standard padded Base64 for unambiguous round trips.
The Base64 decoder is intentionally strict. The input length must be a multiple of four, required equals padding must be present, padding may appear only at the end, whitespace is not ignored, and every character must belong to the standard Base64 alphabet. It also decodes and re-encodes the bytes to reject nonzero pad bits that would create a second non-canonical spelling of the same data.
Strict canonical validation is useful when comparing signed data, protocol fixtures, cache keys, or exact serialized values. Many email and command-line decoders accept line wrapping or omit padding under a separate profile. Some web APIs use base64url, which replaces plus and slash with hyphen and underscore and often omits padding. Those variants are not silently accepted here because guessing the profile can conceal input mistakes.
The hexadecimal parser likewise requires two digits per byte with no 0x prefix, separators, whitespace, underscores, or odd trailing nibble. Uppercase and lowercase input digits are accepted, but output is lowercase. A value such as 0f represents one byte; f alone is incomplete and rejected. This makes byte boundaries explicit and prevents coercions that might change the intended binary value.
Base64 and hex are reversible encodings, not encryption, hashing, signing, compression, authentication, or access control. The output reveals exactly the same bytes as the input. Converting a credential, token, private key, personal record, or secret does not protect it. Keep sensitive values out of untrusted clipboards, logs, screenshots, issue trackers, analytics fields, and shared browser sessions.
The converter does not interpret the bytes as UTF-8, numbers, certificates, images, JSON, cryptographic keys, checksums, or files. It also does not add MIME headers, data-URL prefixes, line wrapping, or checksum fields. If an application expects one of those containers, use the converted bytes as one layer and validate the surrounding format independently.
Input is limited to 500,000 decoded bytes to bound browser memory and output size. Conversion uses numeric byte arrays rather than browser text coercion, output is never silently truncated, and malformed input produces a specific error without a partial result. The copy action copies only the converted value, not labels or explanatory text.
Correctness is locked by eight external cases based on RFC 4648: the empty byte sequence, the standard f, fo, foo, foob, fooba, and foobar vectors, plus a byte sequence exercising Base64 alphabet values 62 and 63. The reverse assertions prove Base64-to-hex and hex-to-Base64 against the same independent expected values. Non-canonical padding and malformed alphabet cases are tested separately.
Use this page when a specification gives bytes in one representation and another tool expects the other. First identify whether the source really uses standard Base64 rather than base64url or MIME formatting. Then convert, compare the byte length, and preserve any leading zero bytes shown as 00 in hex. For security-sensitive protocols, compare the final representation against the governing specification or official test vector rather than treating a successful conversion as semantic validation.
Methodology & sources
The converter implements RFC 4648 Base64 four-character quanta and Base16 two-digit bytes. Decoding re-encodes the result to require canonical padding and zero pad bits; neither direction performs text interpretation.
Frequently asked questions
Related tools
- Base64 Encode / DecodeEncode or decode Base64 instantly with full UTF-8 support β emoji and accents work, all in your browser.
- Text To HEXEncode text into exact UTF-8 hexadecimal with continuous, spaced, or 0x-prefixed output and explicit Unicode replacement warnings.
- Hex to Text ConverterParse hexadecimal bytes with explicit separator and 0x-prefix rules, then decode only complete valid UTF-8 without silent replacement.
- URL DecoderPercent-encode or decode URLs and query values instantly in your browser β Unicode-safe, with clear errors on malformed input, and nothing uploaded.
- AES Encryption OnlineEncrypt text into a portable authenticated AES-256-GCM JSON package or decrypt a package with its password entirely in your browser.
- ASCII ConverterConvert standard 7-bit ASCII text to decimal codes or decode decimal codes back to exact ASCII characters locally.