Developer Tools · · 6 min read
Base64 Encode and Decode Online
Encode text to Base64 and decode Base64 back to text online — full Unicode support, instant results and nothing leaves your browser.
Base64 turns any text or binary data into a safe, portable string of 64 familiar characters. You meet it in data URIs, email attachments, JSON Web Tokens and configuration files — usually in one of two situations: you need to encode something that contains characters a system rejects, or you found a Base64 blob and need to decode it back to something readable. Both directions, instantly and privately, are what the free tools on this page do.
What is Base64?
Base64 is a binary-to-text encoding scheme. It takes every 3 bytes of input, packs their 24 bits into 4 groups of 6 bits, and maps each 6-bit group onto one of 64 printable characters: A–Z, a–z, 0–9, + and / (the URL-safe variant swaps the last two for - and _). Because the output is entirely alphanumeric, it survives systems that choke on raw binary or special characters — old email protocols, XML documents, JSON payloads, URL query strings.
When should you use Base64?
- Embedded assets — small images and fonts inlined as
data:URIs inside HTML, CSS or SVG to avoid an extra request. - Transporting binary through text channels — the original reason it was invented: email attachments (MIME) and JSON APIs that can only carry strings.
- JWTs — a JSON Web Token is three Base64URL segments joined by dots; the middle segment is your payload encoded exactly this way.
- Configuration and data files — certificates, SSH keys and PGP blocks are commonly printed in Base64.
- Quick obfuscation in demos — hiding a spoiler or a lazy-loaded string from casual inspection (never for real security).
How do I encode text to Base64 online?
- Open the free Base64 Encoder.
- Paste or type your text — emoji, accents and non-Latin scripts are supported.
- The encoded string appears instantly as you type; there is no submit button to wait for.
- Copy the result and paste it wherever it needs to go.
Worked example: Hello → SGVsbG8=. With a non-ASCII character, UTF-8 kicks in first: café → Y2Fmw6k=. Decode either one and you get the original text back exactly.
How do I decode Base64 back to text?
- Open the Base64 Decoder and paste the encoded string.
- The readable text is produced immediately; malformed input gets a clear error instead of mojibake.
- Decoding is the exact inverse of encoding, so
SGVsbG8=→Hello, every time.
If the decoded output looks like gibberish, the input was probably URL-encoded %20 style rather than Base64 — switch to the URL Encoder / Decoder.
Why is Base64 33% bigger than the original?
Because 3 bytes of input produce 4 characters of output: 24 bits in, 24 bits out — but each output character carries only 6 bits of information in an 8-bit byte. Four characters cost 32 bits to represent 24 bits of data, a ratio of 4/3, or +33%. That is also why padding = characters appear: input lengths that are not multiples of 3 are padded to complete the final group. The trade-off is deliberate — portability for size — so never Base64 large binaries you could send as binary.
Base64 vs URL encoding — which should I use?
- Base64 encodes whole blocks of data into a compact alphabet of 64 characters; output uses
+,/and=. Use it for blobs, tokens and embedded assets. - URL encoding (percent-encoding) escapes individual unsafe characters as
%XXhex sequences — a space becomes%20. Use it for query parameters and individual characters inside a URL. - Putting raw Base64 straight into a URL usually breaks on the
+(read as a space) and/— which is exactly what the URL-safe Base64 alphabet and percent-encoding solve.
Is Base64 encryption?
No — and this is the most common misunderstanding. Base64 has no key and no secrecy: any tool, in any language, decodes it in one step. It hides text from a casual glance at view-source and nothing more. Anything sensitive — passwords, API secrets, personal data — must be protected with real encryption or proper hashing, never Base64. (One place you will still meet it: the Authorization: Basic header, where credentials are Base64-encoded and expected to travel over HTTPS.)
Frequently asked questions
How do I know if a string is Base64?
Base64 output only contains the characters A–Z, a–z, 0–9, +, / and = padding, and its length is a multiple of 4. If a string looks like random letters with an = or == at the end, it is very likely Base64 — try decoding it to confirm.
Why does my Base64 string end with = signs?
The = characters are padding. Base64 encodes 3 bytes into 4 characters, so when the input length is not a multiple of 3, filler characters are added to reach a complete group of four.
Can you Base64 encode an image or a file?
Yes — Base64 encodes any binary data, which is why images appear as data URIs in HTML and CSS. Our online tool works on text: paste the text (including emoji and non-English characters) and it is encoded with UTF-8 before conversion.
Is Base64 safe for storing passwords?
No. Base64 is encoding, not encryption — anyone can decode it in one step without a key. Never store passwords as Base64; use a dedicated hashing algorithm with a salt, such as bcrypt or Argon2.
Does Base64 work with emoji and non-English text?
Yes, provided the text is converted from UTF-8 first, which the online encoder does automatically. Accented letters, Cyrillic, CJK characters and emoji all round-trip back to the original text on decoding.