A little tool for your toolkit

Base64 Encoder & Decoder

Encode UTF-8 text to Base64, or decode Base64 back to text.

Paste or type text
Processed in your browser; input is not sent to the server.

Accepts standard Base64, including missing padding and whitespace. Decoded data must be UTF-8 text. Base64 is encoding, not encryption.

A practical guide to Base64

What is Base64?

Base64 is a way to represent bytes using a limited set of printable characters. Standard Base64 uses uppercase and lowercase letters, digits, plus and slash; an equals sign may appear as padding at the end. For example, the UTF-8 text hello becomes aGVsbG8=. Decoding reverses the representation and recovers the original bytes when the input is valid.

Base64 is an encoding, not encryption. Anyone who can read an encoded value can normally decode it, so it should never be treated as a way to hide a password, token, or personal information. It also expands data: four encoded characters typically represent three input bytes, before any additional padding or line breaks.

Common developer uses

Developers use Base64 when bytes need to travel through a text-oriented interface. Examples include attachments in some email formats, binary content embedded in data URLs, and encoded values in application protocols. Some systems also use a different alphabet called Base64url, which replaces plus and slash with hyphen and underscore. Check the requirements of the receiving system rather than assuming every variant is interchangeable.

This tool encodes text as UTF-8 bytes and then produces standard Base64. To decode, paste standard Base64 and select Decode. It accepts ordinary whitespace and omitted padding, but expects the resulting bytes to be valid UTF-8 text. It is not a general file converter and does not decode Base64url directly. Use Use output as input to check a round trip, or copy the result into another application.

How to fix common errors

If decoding fails, first check for characters outside the standard alphabet. A hyphen or underscore may indicate Base64url rather than standard Base64. Make sure the value has not been truncated, and remove any surrounding labels or data URL prefix before decoding only the encoded payload. Padding, if present, must be at the end and must be valid for the length of the input.

An error about UTF-8 does not necessarily mean the Base64 itself is invalid. The decoded bytes might represent an image, a compressed file, or text in a different character encoding. This text tool cannot display those bytes reliably; use a file-aware decoder or the correct character encoding instead. For multilingual text, ensure both the producer and consumer agree on UTF-8.

A common integration issue is encoding twice or forgetting to decode at the receiving end. Compare the original and decoded values and confirm whether the protocol expects raw text, bytes, or Base64. Preserve capitalization: changing even one letter changes the decoded data. If a message includes a prefix such as data:, follow that format's rules rather than treating the whole string as Base64.

Privacy and safety

Encoding and decoding on this page happen in your browser; the tool does not submit your input to the server. Even so, avoid exposing sensitive values to untrusted devices or browser extensions. If confidentiality is required, use appropriate encryption and secure key management instead of Base64.