Free Online Calculators

Base64 Encode/Decode

Encode text to Base64 or decode Base64 back to text instantly. Works with any language, emoji and Unicode text - everything runs in your browser, nothing is uploaded.

Base64 Tool

What is Base64?

Base64 is an encoding scheme that converts binary data into printable ASCII text using 64 characters: A–Z, a–z, 0–9, + and /. Every 3 bytes (24 bits) become 4 Base64 characters of 6 bits each, so encoded output is about 33% larger than the input. When the input length is not a multiple of 3, one or two = characters are added at the end as padding.

Base64 is an encoding, not encryption: it uses a fixed public alphabet and no key, so anyone can decode it instantly. Never use Base64 to hide passwords or other secrets.

How to Use This Tool

1. Paste or type your text into the input box and click Encode to Base64 to get the Base64 string.
2. To reverse it, paste the Base64 string into the input box and click Decode from Base64 - line breaks and spaces in pasted Base64 are handled automatically.
3. Click Copy Output to copy the result to your clipboard.

Everything runs in your browser with JavaScript - your text is never sent to any server.

Worked Example

The text Hi encodes to SGk=. The bytes for H (72) and i (105) are 01001000 01101001 in binary. Split into 6-bit groups (with zero bits padding the last group): 010010 000110 100100 = values 18, 6, 36, which map to the characters S, G and k. One = sign is added because 2 bytes do not fill a complete 3-byte group.

Where Base64 Is Used

Email attachments (MIME encoding), data URIs that embed images or fonts directly in HTML/CSS, HTTP Basic authentication headers, API keys and tokens, storing binary data inside JSON or XML, and JWT tokens (which use the URL-safe Base64URL variant).

Base64 vs Base64URL

FeatureBase64 (standard)Base64URL
Character 62+-
Character 63/_
Padding (=)Usually requiredOften omitted
Typical useEmail, data URIs, Basic authJWT, URL parameters, filenames

This tool works with standard Base64.

Frequently Asked Questions

Q: Is Base64 a form of encryption?
A: No. Base64 is an encoding scheme, not encryption - it uses a fixed public alphabet and no key, so anyone can decode a Base64 string instantly. It provides zero security; never rely on it to protect sensitive information.

Q: Why does my Base64 output end with = or ==?
A: Those are padding characters. Base64 processes data in 3-byte groups; when the input length is not a multiple of 3, one or two = signs fill out the final group so the output length stays a multiple of 4 characters.

Q: Does Base64 make data bigger?
A: Yes. The output is about 33% larger than the input (4 characters for every 3 bytes), plus up to 2 padding characters.

Q: Can this tool handle Hindi, Bengali, emoji and other Unicode text?
A: Yes. Text is encoded as UTF-8 first, so any language or emoji round-trips correctly through encode and decode.

Q: Is my text uploaded anywhere when I use this tool?
A: No. Encoding and decoding run entirely in your browser with JavaScript - nothing is sent to our server.

Q: What is the difference between Base64 and Base64URL?
A: Base64URL replaces + with - and / with _ and usually drops the = padding, so the string is safe inside URLs and filenames. JWT tokens use Base64URL. This tool uses standard Base64.

Press / to open  ·  Esc to close