What it does
The Base64 tool encodes text to Base64 and decodes it back, and does the same for files of any type. It supports the URL-safe variant used in JWTs and web addresses, and line wrapping at 76 characters for email (MIME).
How to use it
Text
- Type or paste text into Text (UTF-8) to encode it, or paste Base64 into the Base64 pane to decode it.
- Tick URL-safe to use
-and_without=padding, or Wrap at 76 for MIME.
Files
- Open the File ⇄ Base64 section.
- Encode a file to get its Base64 or data URI.
- Or paste Base64 and choose Decode to a file to download the original file.
Example
| Text | Base64 | URL-safe |
|---|---|---|
Hello, wörld! |
SGVsbG8sIHfDtnJsZCE= |
SGVsbG8sIHfDtnJsZCE |
Good to know
- Base64 is not encryption. Anyone can decode it. Use Encrypt / Decrypt to protect data.
- Base64 makes data about a third larger: every 3 bytes become 4 characters.
- Text is encoded as UTF-8, so accented letters and emoji round-trip correctly.
FAQ
What is the difference between Base64 and Base64URL?
Base64URL replaces + and / with - and _ and usually drops the = padding, so the result can be used in URLs and file names. JWTs use Base64URL.
How do I turn an image into Base64 for CSS or HTML? Use Image to Base64, which also builds the CSS, HTML and Markdown snippets.