Check a round trip through Base64 and hexadecimal
Admin ·
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.
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.
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
- How to Convert Base64 to a File and Download It
- Data URL payload and media type guide
- Unicode and hex byte escape guide
- Percent escapes and form spaces guide
- Read a Repeating-Key XOR Byte Table
- Rename Three Files and Check the ZIP
- Check a Digest Before and After Adding a BOM
- Find a Byte Pattern That Crosses a Page