Worked examples

Convert Hex to Base64: ff0080 becomes /wCA

Convert three binary bytes from hexadecimal to Base64 without decoding them as UTF-8 text. Compare the exact input and output.

Use a byte-to-byte conversion when your data is not text. This example takes the hexadecimal pairs ff, 00 and 80 and represents those same three bytes as Base64. No UTF-8 text decoding is needed, so the invalid text sequence does not prevent this conversion.

Example input

ff0080

Expected result

/wCA

Try it step by step

  1. Open the Hex and Base64 converter and select Hex to Base64.
  2. Enter ff0080 and run the conversion. Check the exact result /wCA.
  3. Choose Base64 to Hex and enter /wCA to recover ff0080.

How to read the result

Each Hex pair represents one byte, so six hexadecimal digits are three bytes. Base64 encodes those bytes in four characters here, with no padding needed for this three-byte input. Converting the literal text ff0080 to Base64 would encode six text characters and produce a different result.

Limits and important details

Hex and Base64 are reversible encodings, not encryption. An odd number of Hex digits or invalid characters is rejected. Binary output does not have to be valid UTF-8 and should not automatically be interpreted as readable text.

RFC 4648

Open the tool