What is Base64?
Base64 writes any data — text, an image, a file — using 64 safe characters: A–Z, a–z, digits, “+” and “/”. Every 3 bytes become 4 characters, so encoded data is about a third longer. The “=” at the end pads the last group.
Example: “Hello, world” is SGVsbG8sIHdvcmxk. The converter first turns text into UTF-8 bytes, so accented characters work correctly: “Café” is Q2Fmw6k=.
Where Base64 is used
- Email attachments (MIME) are sent as Base64.
- Images embedded in HTML and CSS as data URIs: data:image/png;base64,…
- JWT tokens, the HTTP Basic Auth header, keys and certificates in PEM format.
- Sending binary data in JSON and XML, which only accept text.
Base64 is not encryption
Anyone can decode Base64 without a key — it is just another way of writing the same data. Never use it to hide passwords or personal data. Use encryption to protect data and hash functions such as SHA-256 to check integrity.
Frequently asked questions
Why does the decoded text look garbled?
The data may have been encoded in something other than UTF-8 (e.g. Windows-1252), or it isn’t text but a binary file. The converter tells you when the result isn’t valid UTF-8.
What is Base64URL?
A variant that uses “-” and “_” instead of “+” and “/” so the data can go into a URL — you’ll see it in JWT tokens, for example.