File encoding guides

Check a round trip through Base64 and hexadecimal

·

Represent file bytes in Base64 or hexadecimal and restore them. Select Encode or Decode and choose Base64 or Hexadecimal. Use a local file or pasted text.

Base64 and Hex File Converter

Read the same four bytes in two alphabets

A file with hexadecimal bytes 00 41 FF 0A becomes AEH/Cg== in Base64 and 0041FF0A in hex. Decode either string, name the output four.bin and check it in a hex viewer. The leading zero and final line feed are part of the file.

RFC 4648 — Base encodings

Extract a file from saved Base64 text

Choose Decode and Base64, then set Input source to Local file. Select the text file that holds the payload. Spaces and line breaks can separate encoded characters. Use Data URI to File if the saved text also contains a data URL header.

Recover a binary payload without text conversion

For bytes 00 41 FF 0A, a text editor may hide the first byte and display a replacement character for FF. Compare the recovered file in hex and confirm that the final 0A remains. Omitting that final byte produces a different file even if the visible text looks similar.

If another system supplies a data URL, separate its header from the encoded payload or use the Data URI to File tool. A media-type declaration is not part of the file bytes.

Common questions

Why did a Base64 string with plausible characters fail?

The decoder checks padding, trailing pad bits and alphabet consistency. An incomplete group or mixed standard and URL-safe alphabets can fail these checks.

Does changing the download extension convert the file?

The extension labels the download. Its bytes are determined by the encoded payload.

Sources

Put it into practice.

Related guides