Base64 file decoder

Paste base64 text — or load a .txt or .b64 file containing it — to decode it back into a file, preview it if it is an image, and download the result.

About this tool

The decoder strips an optional data URL prefix and any whitespace, decodes the base64 into raw bytes in the browser, and identifies the result from its opening signature bytes — the same magic numbers file formats start with. Image results are previewed directly on the page. The download uses a sensible filename and extension for the detected type, or a generic .bin name when the bytes match no known signature. Nothing is uploaded: decoding a large pasted string happens entirely on the local machine.

Common questions

What is a data URL prefix? Data URLs start with a header such as data:image/png;base64, before the actual base64. That prefix can be pasted along with the data — the decoder removes it automatically.

Why is the decoded file smaller than the pasted text? Base64 represents three bytes of data with four characters, so the encoded text is about a third larger than the file it encodes. Decoding restores the original byte count.

What happens with invalid base64? Characters outside the base64 alphabet, or a length that cannot decode, produce a clear error and no file. Trailing padding (=) is part of the format and should be kept.

Private by design: this tool runs entirely in your browser. Nothing typed, pasted, or opened here is uploaded, stored, or tracked.