How to encode and decode Base64
Choose Encode or Decode, then type or paste. The result appears as you type, so there is no button to press. Swap moves the result back into the input and flips the direction, which is the quickest way to check a round trip.
To encode a file, such as an image for a data URI or a certificate for a config file, press or choose a file. Files up to 20 MB are read on your device. They are not uploaded.
URL-safe Base64 decoder
Standard Base64 uses + and /, which both mean something else inside a URL. The URL-safe variant swaps them for - and _ and usually drops the = padding. You will meet it in JWTs, OAuth state values and signed links.
When decoding, we accept both variants automatically, padded or not. When encoding, tick URL-safe to produce the variant.
Why won't my Base64 decode?
We tell you which of these it is, and where:
- An invalid character. Often a space, a line break pasted from an email, or a smart quote. We point to its position.
- A string that was cut short. Base64 comes in groups of four characters. One character left over means something was lost when it was copied.
- It is not text. If the bytes are an image or a zip file we say so, and Download saves them as a file.
Base64 is not encryption
Anyone can decode Base64. It hides nothing. It exists so that binary data can travel through systems built for text, such as email, JSON and HTML. If you find a password in a config file "protected" by Base64, treat it as plain text and rotate it.
Encoding makes data about a third larger: every three bytes become four characters.
Where you will run into it
- The
Authorization: Basicheader, which isuser:passwordin Base64. - Email attachments and inline images.
- Kubernetes secrets and PEM certificates.
- The header and payload of a JWT. Our JWT Decoder reads those directly.
Private by design
Tokens and credentials are exactly the kind of thing people paste into a Base64 decoder, so it matters where the decoding happens. Ours happens in your browser. Nothing you paste is sent to us, and the text is forgotten when you close the tab.
Last reviewed November 15, 2026.