Base64 Decode and Encode Text, files and images, in your browser
Decode Base64 or encode text and files. Preview supported images and download the original bytes.
How to decode Base64
Paste the encoded value
Decode is selected when the page opens. Paste Base64 into the input to see the result as you type. Spaces and line breaks are ignored. The decoder accepts the standard alphabet, URL-safe characters, missing padding and a data URI prefix such as data:image/png;base64,.
If a character is invalid, the error identifies the first one and its position in the original input. Positions start at one. An impossible length or misplaced padding gets its own explanation. Do not remove arbitrary characters just to make a damaged value decode.
Work with files and images
Choose a file to encode its bytes locally. Enable the data URI option when you need the media type and encoded value together. When decoding, PNG, JPEG, GIF, WebP and PDF are recognized by their file signatures. Supported images show their pixel dimensions and a preview. Binary data has a hex preview and a download button.
A matching signature does not guarantee a complete or valid file. If an image cannot be displayed, its bytes remain available to download. Other file formats receive a .bin extension. No document content is executed by this tool.
What is Base64 encoding?
Base64 represents bytes using a small alphabet of text characters. It is useful when a system needs to carry file data through a text field, message or document. It does not tell you what the original bytes mean; that still depends on a text encoding or file format. This page uses UTF-8 for text and keeps file bytes intact.
The alphabet and padding rules are described in RFC 4648. For encoding, you can choose standard Base64 or URL-safe Base64, toggle padding, and wrap lines at 76 characters. The wrap option is for MIME-style content; ordinary Base64 does not need added line breaks.
How does Base64 work?
Three input bytes contain 24 bits. Base64 splits them into four groups of six bits, then maps each group to a character in its 64-character alphabet. This computed example shows the UTF-8 bytes for Man, the eight-bit bytes, the six-bit groups and the result:
When the final group has fewer than three bytes, padding can complete the four-character output group. The original byte count determines which padding is needed. A decoder can often infer omitted padding from the remaining character count.
Is Base64 encryption?
No. Base64 is reversible encoding. Anyone who has the encoded value can decode it without a key. It does not hide passwords, tokens or private documents. Encoding a file also does not compress it: the Base64 payload is about four thirds of its original byte size, with padding and any prefix adding more.
Base64 FAQ
Why does Base64 end with =?
The equals sign is padding for the final group. Depending on the number of input bytes, the output needs zero, one or two padding characters. This decoder can also read values with the padding omitted.
What is the difference between Base64 and Base64URL?
Base64URL replaces + and / with - and _. Many uses also omit padding. Turning on URL-safe here turns padding off by default; you can turn it back on if the receiving format requires it.
Why is Base64 bigger than the original?
Each Base64 character carries six bits, while each original byte contains eight. Three bytes therefore become four characters. For short inputs the padding has a proportionally larger effect.
What is a Base64 image?
It is an image file represented as Base64 text, sometimes inside a data URI that also names its media type. Decode it here to inspect recognized image formats and download the original bytes.
Why does the result look like binary data?
The bytes may represent a file rather than UTF-8 text, or they may use a different text encoding. This page reports invalid UTF-8 instead of silently replacing bytes. Inspect the file type and hex preview before deciding how to use the result.
Is my input stored or uploaded?
No. Conversion, local file reading and previews happen in this page. Your input is not saved to browser storage or sent to a conversion server.