Base64 encoder and decoder

Up to 5 MiB of text or file data. Base64 input can contain up to 8 MiB of characters, including whitespace.

Whitespace is ignored. Standard and URL-safe Base64 are accepted, with or without padding.

Enter Base64 and select Decode.

Decoded result

Detected type
—
Decoded size
—
Decoded text or an image preview will appear here. PDFs and other files can be downloaded.

How to use this tool

To decode, paste Base64 into the input and select Decode. Text and PNG or JPEG images have a preview. Use Download file to save the decoded bytes, or Copy text for UTF-8 text.

To encode, select Encode to Base64, choose a file or switch to Text, and select Encode. Choose Raw Base64, URL-safe Base64 or Data URL, then copy or download the output.

When to use it

Read an encoded value from an API response, create a data URL for a small image, or convert a file to Base64 for a system that accepts text. Base64 represents bytes using text characters; it is not encryption and does not protect a secret.

Example

The text Hello encodes to SGVsbG8=. Decoding that value returns Hello. URL-safe output uses - and _ in place of + and / and omits trailing padding.

Privacy and data handling

Text, selected files, clipboard contents and results stay in your browser. The tool does not upload them, save them in browser storage or add them to a URL. File selection and dropping a file read a local copy. Clipboard access happens only when you select Paste or Copy.

The site stores your theme choice and uses Cloudflare Web Analytics for page visits and loading performance. Tool data is excluded. See the privacy page for details.

Formats and limits

Text encoding uses UTF-8. The decoder accepts standard Base64, URL-safe Base64 and Base64 data URLs. Missing padding is accepted; malformed padding and invalid characters produce an error.

PNG, JPEG and PDF signatures identify those file types. Other data URLs supply a media type; raw input is checked for UTF-8 text, otherwise treated as binary. A media type is a hint, not a file validation. PDFs are download-only. Unrecognised files and text that is not valid UTF-8 have no preview, but their decoded bytes can be downloaded.

Each conversion is limited to 5 MiB of data, and Base64 input to 8 MiB of characters including whitespace. Text previews show at most 200,000 characters; copying and downloading preserve the full result. Encoding adds about one third to the data size. Browser text fields normalise line endings; file encoding preserves the original bytes.

Editing an input clears its previous result. Clear in the encoder removes the selected file, text and output. Use the format expected by the receiving system; some systems require padding or a particular media type.