How to encode or decode Base64
- Encode: type or paste text, then click Encode to get its Base64 form.
- Decode: paste Base64 and click Decode to get the original text.
- Files: choose any file to get a
data:URI you can use in HTML or CSS.
Text is encoded as UTF-8, so accented letters, non-Latin scripts and emoji work correctly. Many simple Base64 tools break on these characters.
Example
The text Hello encodes to SGVsbG8=. The = at the end is padding that makes the length a multiple of 4.
Common uses of Base64
- Embedding small images directly in HTML, CSS or emails
- HTTP Basic authentication headers
- JSON Web Tokens (JWTs), which use URL-safe Base64
- Storing binary data in JSON or XML