What is Base64 for?

Base64 writes any data with 64 characters that pass safely through systems made for plain text: A to Z, a to z, 0 to 9, + and /, with = as padding at the end. Every 3 bytes become 4 characters, so the result is about a third longer than the original. Email uses it to carry attachments, web pages use it in data: URLs to hold small images and fonts, and HTTP Basic authentication sends the user name and password in it. It's an encoding, not encryption: anyone can decode it, so it keeps nothing secret.

Tool description

Type or paste text into the Decoded box, and its Base64 appears in the Encoded box as you type, ready to copy. The text is encoded as UTF-8, the character encoding most programs and websites use, so any language, symbol or emoji works, and the result matches what other tools and programming languages give.

To turn Base64 back into text, press the swap button between the boxes, which also moves the result into the input, or use the Base64 Decoder.

Features

  • Encodes text to Base64 as you type
  • UTF-8, so every language and emoji works
  • Standard Base64 with +, / and = padding
  • Runs in your browser

Examples

Decoded Encoded
Picnic at noon UGljbmljIGF0IG5vb24=
Happy birthday! SGFwcHkgYmlydGhkYXkh
café Y2Fmw6k=
€ 4oKs
👋 8J+Riw==

Good to know

  • The = signs fill out the last group of four characters: Sun gives U3Vu, Su gives U3U= and S gives Uw==.
  • Spaces and line breaks are part of the text: Hi gives SGk=, but Hi with a line break after it gives SGkK. If your Base64 doesn't match someone else's, look for a stray space or line break.
  • Letters like é take two bytes in UTF-8, so café gives Y2Fmw6k=. Programs that save text in Latin-1, an older encoding, give Y2Fm6Q== instead.
  • URL-safe Base64, used in web addresses and file names, writes - and _ in place of + and / and often leaves out the =. This tool writes standard Base64: Lunch? gives THVuY2g/, which is THVuY2g_ in URL-safe Base64.
  • To encode a file or an image, use the File to Base64 Converter.