Base64 Encoder & Decoder
Encode text to Base64 or decode Base64 back to readable text. It supports UTF-8 characters, emoji and URL-safe Base64, and everything happens in your browser.
How to use the Base64 Encoder & Decoder
- Choose Encode to turn text into Base64, or Decode to turn Base64 back into text.
- Type or paste your input. The result updates as you type.
- Tick URL-safe if you need Base64 for URLs or tokens. Click "Copy result", or "Swap input and result" to check the round trip.
What is Base64?
Base64 is a way of writing data using only 64 plain characters: the letters A-Z and a-z, the digits 0-9, and
the symbols + and /, with = used as padding. It lets binary or special
characters travel safely through systems that only handle text, such as email, JSON, HTML and URLs.
Every 3 bytes of input become 4 Base64 characters, so the encoded text is about 33% longer than the original.
Examples
| Text | Base64 |
|---|---|
| Hello | SGVsbG8= |
| Hello, World! | SGVsbG8sIFdvcmxkIQ== |
| user:pass | dXNlcjpwYXNz |
Standard Base64 vs URL-safe Base64
Standard Base64 uses + and /, which have special meanings in URLs. URL-safe Base64
(also called Base64URL) replaces them with - and _ and usually drops the
= padding. It is used in web tokens such as JWTs. When decoding, this tool accepts both versions
automatically.
Common uses of Base64
- Embedding small images or fonts directly in HTML and CSS as data URIs
- Sending binary data inside JSON or XML in an API request
- Email attachments, which are encoded with Base64 (MIME)
- HTTP Basic authentication headers, which carry
username:passwordin Base64 - Reading the contents of web tokens and configuration values while debugging
Important: Base64 is an encoding, not encryption. Anyone can decode it in seconds, so never use it to hide passwords or other secrets.
Frequently asked questions
Is Base64 encryption?
No. Base64 only changes how data is written and gives no protection. Anyone can decode it, so use real encryption to protect sensitive data.
Why does Base64 end with = or ==?
The equals signs are padding. Base64 works in groups of 3 bytes, and one or two = characters fill the last group when the input length is not a multiple of 3.
Does this tool support Unicode and emoji?
Yes. Text is converted with UTF-8 before encoding, so accented letters, non-Latin scripts and emoji encode and decode correctly.
Why do I get an error when decoding?
The input is probably not valid Base64, or it decodes to binary data such as an image instead of text. Check for missing characters, and remove anything that is not part of the Base64 string.
What is URL-safe Base64?
It is a variant that uses - and _ instead of + and /, and often omits the = padding, so the result can be used safely in URLs and file names.
Is my data uploaded or stored?
No. The tool is free and everything runs in your browser. Your text is never uploaded to a server or stored.