What Is Base64 and How Do You Encode or Decode It?
You have probably seen a long string of letters and numbers ending in "==". That is likely Base64. It is a way to write any data, even pictures or files, using only safe characters: letters, numbers, plus and slash.
Why does it exist?
Some systems, such as email and older web tools, are built for plain text. Raw binary data can break them. Base64 turns the data into text, so it travels safely. When it arrives, you decode it back.
A small example
The text Hello becomes SGVsbG8=. Decode that and you get Hello again.
Where you see it
- Images embedded inside web pages and CSS.
- Email attachments.
- The "Authorization: Basic" header used by some APIs.
- Parts of login tokens.
Important: it is not encryption
This is the biggest misunderstanding. Base64 does not hide anything. Anyone can decode it in a second. Never use it to protect passwords or private data.
It makes data bigger
Base64 output is about one third longer than the original. That is fine for small things, but a poor choice for big files.
URL-safe Base64
Normal Base64 uses plus and slash, which have special meaning in web addresses. A URL-safe version swaps them for a dash and an underscore and often drops the "=" at the end. Our tool has a checkbox for this.
Accents and emoji
Some simple tools fail with text like "café" or with emoji, because they handle only basic English letters. The Base64 converter on our Developer Converters page encodes your text as UTF-8 first, so any language works.
How to use it
- Open the Base64 tool.
- Choose Encode or Decode.
- Paste your text. The result shows instantly.
- Press Copy.
If decoding fails, the text is probably not valid Base64, or it holds a file instead of text. Nothing you type leaves your browser.
Frequently asked questions
Is Base64 a form of encryption?
No. Anyone can decode Base64 instantly, with no key. It only changes how data is written so it can travel safely through systems that expect text. Never use it to hide passwords or private data.
Why does Base64 end with = signs?
Base64 works in groups of three bytes. When the data does not divide evenly, one or two = signs are added as padding so the length is a multiple of four characters.
How much bigger does Base64 make a file?
About one third bigger: every 3 bytes become 4 characters. A 300 KB image becomes about 400 KB of Base64 text, which is why large images should not be embedded this way.
Can I convert an image to Base64?
Yes. Images are often embedded in web pages and emails as Base64 "data URLs". For text, use our Base64 encoder, which handles accents and emoji correctly.
Open the free Developer Converters. It runs in your browser, so nothing is uploaded.