Base64 Encoder & Decoder

Convert text to Base64 or back to UTF-8 with standard and URL-safe alphabets, or convert an image file to a data URI and Base64 back to a downloadable image.

Text stays in this page’s memory and is omitted from share links. Reloading clears it. Limit: 100,000 UTF-16 units.

0 UTF-16 units in the output.

Base64 is reversible encoding, not encryption. Input text uses UTF-8; decoding accepts optional padding and ASCII whitespace, and rejects invalid UTF-8 or noncanonical trailing bits.

Encoding Unicode text

The encoder turns your text into UTF-8 bytes, then represents those bytes with Base64 characters. Standard output uses the + and / characters and final = padding when needed. URL-safe output uses - and _ instead and omits padding.

For example, Hello becomes SGVsbG8=. The emoji 😀 becomes 8J+YgA==. Choose the alphabet expected by the system receiving your text.

Decoding and validation

This decoder accepts padded or unpadded input and ignores ASCII spaces, tabs and line breaks. It rejects characters outside the chosen alphabet, misplaced padding and nonzero unused trailing bits.

The output must be valid UTF-8 text. Encoded images, archives and other binary files may not decode as text. A decoding error does not necessarily mean a binary file is corrupt; it may simply not be text. Use Image file mode for pictures.

Images and data URIs

Set Input type to Image file to work with pictures. Encode reads a PNG, JPEG, GIF, WebP, BMP, ICO, AVIF or SVG file on your device with the browser's FileReader and shows it as Base64 and as a data URI such as data:image/png;base64,iVBORw0KGgo…, ready for an HTML src attribute or a CSS url(). The file is never uploaded.

Decode accepts a full data URI or bare Base64 in either alphabet, checks the bytes, shows a preview and lets you download the image. The type is read from the file's own signature bytes, so a mislabeled data URI is reported. Images are limited to 2 MB (about 2.8 million Base64 characters), because Base64 text is 4 ÷ 3 of the file size: a 30,000-byte icon becomes 4 × ⌈30,000 ÷ 3⌉ = 40,000 characters.

Copy, reverse and privacy

Use Copy result to copy only the output. Reverse conversion places the result in the input and changes direction. It is unavailable if the output exceeds the input limit of 100,000 UTF-16 units.

Input is held in page memory and is not placed in a URL or local storage. Share links omit it, and reloading clears it. Base64 does not conceal information: anyone with the encoded text can decode it.

Frequently asked questions

Is Base64 encryption?

No. It is a reversible representation of bytes without an encryption key.

Can I decode a binary file here?

Text mode is for UTF-8 text, and bytes that do not form valid UTF-8 produce an error rather than replacement characters. For pictures, switch Input type to Image file to decode Base64 into a previewable, downloadable image up to 2 MB.

Why are standard and URL-safe results different?

They use different characters for two alphabet entries. This encoder also omits padding in URL-safe mode.

References

Last updated . Results are estimates for informational purposes only.