zerouploads

Base64 Encoder

Encode text or files to Base64 in your browser. Standard or URL-safe alphabet, with or without padding.

  • Unlimited
  • No signup
  • Private
  • Works offline

Base64 ConverterText or files, either direction

67 characters · 69 bytes UTF-82 lines

Base64Valid

emVyb3VwbG9hZHMg4oCUIGl0IGRvZXNuJ3Qgc3RvcCBhdCB0aHJlZS4KRnJlZSwgdW5saW1pdGVkLCBubyBzaWdudXAu

92 characters · +33% sizeno padding

Encoding settings
69 bytes in / 92 characters out · standard alphabet · no line breaks

How it works

  1. 01

    Paste text or load a file

    Any text, or a file of any type read as raw bytes. It stays in this tab.

  2. 02

    Pick the alphabet

    Standard for most things, URL-safe when the output goes in a link. Padding is optional.

  3. 03

    Copy the output

    Copy it, or download it as a text file. The size figures update as you type.

What Base64 is for

Base64 maps any bytes onto 64 printable characters, so binary data can travel through anything that only carries text. Email bodies, JSON fields, XML attributes and data URIs all use it. Every three bytes become four characters, so the output is always about a third bigger than what went in.

It is an encoding, not encryption. Anyone can decode Base64 instantly, so it protects nothing at all. A token or a password is just as exposed encoded as it was plain. Use it to make bytes safe to carry, and use TLS or real encryption to make them private.

Alphabets
Standard (RFC 4648) and URL-safe, which swaps + and /.
Padding
Trailing = signs pad the length to a multiple of four.
Input
Text as UTF-8 or Latin-1, or any file up to 10 MB as raw bytes.
Size
Output is a third larger, plus padding.

Standard or URL-safe

The standard alphabet uses + and /. Both mean something inside a URL, so servers and clients re-read them or escape them, and the string arrives changed. The URL-safe form swaps them for - and _, so you can put the output in a query string or a path without escaping it.

JSON Web Tokens use the URL-safe form with the padding stripped. That is why a JWT segment never ends in an equals sign, and why the Include padding switch matters when you are matching one.

Frequently asked questions

Is Base64 encryption?
No. It is a reversible encoding with no key, so anyone who sees the output can get the original bytes back in a second. It makes data safe to put in text formats. It does not make it secret.
Why is my encoded output larger?
Because every three bytes become four characters. That is a third more, and short inputs pay more than that because of the padding. It is the cost of using only characters that every text format accepts.
What is the URL-safe alphabet?
The standard alphabet uses + and /, and both mean something inside a URL. The URL-safe form swaps them for - and _, so the output can go into a link untouched.
Can I encode a file, not just text?
Yes. Load any file and its raw bytes are encoded as they are. That is how a small image ends up inside a stylesheet as a data URI.
Do I need the padding characters?
Most parsers want them. Some, including JSON Web Tokens, strip them, and the length alone is enough to work out how many were dropped. Turn off Include padding when you are matching a system that does.
What does the character encoding setting do?
It decides how your text becomes bytes before encoding. UTF-8 handles every character. Latin-1 is there for older systems, and it refuses anything outside its 256 characters rather than mangling it.
Why would I add line breaks?
Older formats need them. Email wrapped Base64 at 76 characters and PEM certificates wrap at 64. The breaks are ignored on decoding, so they are safe to add or leave out.
Is my data uploaded?
No. The encoding happens in this tab, so passwords, tokens and files never leave your device and there is nothing to log.
Does this work offline?
Yes. Once the page has loaded, encoding carries on with no network connection.
Browse all developer tools