Developer tool
Base64 Encoder & Decoder
Encode UTF-8 text to Base64 or decode Base64 back to readable text. Switch on URL-safe output when the value will travel in a URL.
What Base64 is
Base64 is a way to represent binary data using 64 printable ASCII characters: A–Z, a–z, 0–9, plus + and /. Every three bytes of input become four Base64 characters. Padding with = fills out the final group when the input length is not a multiple of three.
It is an encoding, not encryption. Anyone can decode Base64. It adds no secrecy and usually makes the data about a third larger.
Text, bytes and UTF-8
Computers store text as bytes. UTF-8 is the most common way to turn characters into bytes, and it can represent almost every writing system. This tool converts your text to UTF-8 bytes before encoding, and decodes bytes back to UTF-8 text. If the decoded bytes are not valid UTF-8, it reports an error instead of showing garbled output.
URL-safe Base64
Standard Base64 uses + and /, which have special meanings in URLs. The URL-safe variant uses - and _ instead and often removes the = padding. The checkbox enables that output. Decoding accepts either alphabet, so you can paste a value without changing the setting.
Common uses
- Embedding small images or fonts in CSS or HTML as data URLs.
- Email attachments, where MIME encodes binary files as text.
- Carrying binary values inside JSON, XML or other text formats.
- HTTP Basic authentication headers.
- Parts of JSON Web Tokens (JWT), which use URL-safe Base64.
Common mistakes
- Assuming it is secure. It is not. Use encryption and HTTPS for confidentiality.
- Double encoding. If a value already looks like Base64, check before encoding it again.
- Ignoring line breaks. Some Base64 output is wrapped across lines. Remove the whitespace before decoding if a tool rejects it.
- Encoding huge files. Base64 is fine for small payloads. For large images and downloads, send the binary directly.
For a longer explanation of the format, read what is Base64.
Keep going
Related tools
Other utilities that pair well with this one.
Good to know
Questions
Is Base64 encryption?
No. It is a reversible encoding. If you need confidentiality, use encryption and HTTPS, not Base64.
Why does my Base64 end with equals signs?
The equals signs are padding. They make the output length a multiple of four. They can often be removed, but some decoders expect them.
Does this handle emoji and non-English text?
Yes. The tool encodes UTF-8 bytes, so emoji and most writing systems are supported. Decoding requires valid UTF-8 text.
Why did decoding fail?
The input may contain invalid characters, missing padding or bytes that are not valid UTF-8. Check for line breaks and make sure you copied the whole value.
Can I encode a file or image to Base64?
No. This page encodes UTF-8 text. For binary files, use a dedicated tool or a library that reads the file bytes.
Why is my Base64 string longer than the original text?
Base64 represents every three bytes as four characters, so the encoded output is roughly one third larger than the input.