How to use the Base64 Encoder & Decoder
- Choose Encode or Decode.
- Paste your text or Base64.
- Copy the result.
What does this tool do?
Base64 represents binary data using 64 safe characters (A–Z, a–z, 0–9, + and /). It's used in email attachments, data URIs, basic HTTP authentication and JWTs.
Many simple tools break on non-English text because the browser's btoa() only handles Latin-1. This tool converts to UTF-8 first, so any language and emoji round-trip correctly. URL-safe Base64 (with - and _) is decoded automatically.
Why use it?
- Decode tokens and data URIs.
- Encode credentials for testing.
- Works with every language.
Use cases
- Read the payload of a JWT, a data: URI or a Kubernetes secret.
- Build an HTTP Basic Authorization header: “user:pass” encodes to dXNlcjpwYXNz.
- Embed small strings in JSON, XML or email where raw bytes aren't allowed.
Example
“Hello, world!” encodes to SGVsbG8sIHdvcmxkIQ==. “Café ☕” encodes to Q2Fmw6kg4piV.
Common mistakes
- Treating Base64 as security. It hides nothing — anyone can decode it in one click.
- Decoding a file (an image, PDF or ZIP) as text. Binary data isn't readable text; use Image to Base64 for images.
- Mixing alphabets: URL-safe Base64 uses - and _ and often drops the = padding. This tool decodes both forms.
Accuracy and limits
- Base64 is encoding, not encryption. Anyone can decode it, so never use it to protect secrets.
Privacy
Everything you type is processed in your browser. Nothing you enter is sent to our servers or stored by us. There's no account to create and nothing to install.
Frequently asked questions
How do I convert Base64 to an image?
Use the Image to Base64 tool and switch it to “Base64 → Image”. It accepts a full data: URI or plain Base64, shows the picture and lets you download it. This page is for text.
Why does Base64 end with = or ==?
Base64 encodes 3 bytes as 4 characters. When the input isn't a multiple of 3 bytes, = signs pad the last group: “a” encodes to YQ==, “ab” to YWI= and “abc” to YWJj.
Why is the Base64 longer than my text?
Every 3 bytes become 4 characters, so Base64 is about 33% larger than the original. Non-English characters take 2–4 bytes each in UTF-8, so they grow more.
Is my text sent anywhere?
No. Encoding and decoding happen in your browser, so it's safe to decode tokens and credentials here.
Last reviewed by the M2Toolkit team.