How to use the Base64 encoder
- Type or paste your text into Text to encode.
- Choose the Alphabet: Standard (+/) or URL-safe (-_).
- Pick a Line length: No line breaks, 76 (MIME) or 64 (PEM).
- Untick Keep = padding if the system you are sending to does not want it.
- Copy the Base64 output. The stats show the input size in bytes and the output length in characters.
What it does and when to use it
Base64 lets you carry any data through a channel that only accepts plain text. You will meet it when you:
- Put credentials in an HTTP Basic Authorization header, which is the username and password joined by a colon and Base64-encoded.
- Store a small binary value, or text with tricky characters, in JSON, YAML or an environment variable.
- Build or test a JWT, whose header and payload are URL-safe Base64.
- Create email content or data URIs by hand.
To reverse the process, use the Base64 Decoder. If your text is going into a query string rather than a header, the URL Encoder is usually what you need instead. For a more compact text encoding of binary data with a different alphabet, see Base32.
How it works
- Your text is converted to UTF-8 bytes. Plain English letters are one byte each, accented letters two, and most emoji four.
- The bytes are taken in groups of three (24 bits) and split into four groups of 6 bits.
- Each 6-bit value (0 to 63) is written as one character: A–Z, a–z, 0–9, then + and / (or - and _ in the URL-safe alphabet).
- If the last group is short, = signs pad the output to a multiple of four characters, unless you turn padding off.
This follows RFC 4648, the standard that defines Base64 and the URL-safe variant. Everything runs in your browser.
Worked examples
A classic. “Hello, world!” encodes to SGVsbG8sIHdvcmxkIQ==. The 13 input bytes become 20 characters, shown as Output length: 20 characters, including two = signs of padding.
Accents and emoji, URL-safe, no padding. “café 👋” is 10 UTF-8 bytes (é takes two and 👋 takes four). In the URL-safe alphabet without padding it becomes Y2Fmw6kg8J-Riw. Note the - where standard Base64 would use +.
Exactly three bytes. “Man” fills one group perfectly and encodes to TWFu, with no padding.
Limits and tips
- The same text always gives the same Base64, so it is not a way to make something unique or secret.
- Different systems disagree about padding and line breaks. If a receiver rejects your value, try toggling padding first.
- Text is always encoded as UTF-8. If a system expects another character set, the result will not match.
Frequently asked questions
Is Base64 a form of encryption?
Why is the Base64 output longer than my text?
When should I use the URL-safe alphabet?
What do the line length options do?
Can I encode an image or a file here?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.