Base64 Encoder
Encode text or binary data to Base64 — standard and URL-safe variants
How to Use the Base64 Encoder
- Paste text or drag-drop a file into the input.
- The Base64-encoded output appears instantly.
- Toggle URL-safe mode to replace + and / with - and _ (safe for URLs and filenames).
- Copy or download the result.
What is Base64?
Base64 is an encoding scheme that converts binary data into ASCII text using 64 printable characters (A-Z, a-z, 0-9, +, /). It is not encryption — it is purely an encoding format.
Common uses
- Email attachments — MIME encoding for binary files in email
- Data URIs — embed images directly in HTML/CSS as base64 strings
- API payloads — safely transmit binary data in JSON
- JWT tokens — the header and payload sections are Base64URL encoded
- Basic Auth — HTTP Basic Authentication encodes credentials as Base64
Note: Base64 increases data size by ~33%. It is not suitable for large files.
What is Base64 Encoding?
Base64 is an encoding scheme that converts binary data into ASCII text using 64 printable characters (A–Z, a–z, 0–9, +, /). It was designed for safely transmitting binary data over systems built to handle text, like email (MIME) and HTTP headers. Encoding increases data size by roughly 33 % but ensures safe transmission across any text-based channel.
Common Uses
- Encoding images or files as data URIs in HTML/CSS (src="data:image/png;base64,…")
- Sending binary data in JSON API payloads
- HTTP Basic Auth header encoding (username:password → Base64)
- Storing binary data in environment variables or config files
- JWT token payloads are Base64URL-encoded
Frequently Asked Questions
Is Base64 the same as encryption?
No. Base64 is encoding, not encryption. Anyone can decode a Base64 string instantly — it provides no security. Use AES or RSA for actual encryption.
What is the difference between standard Base64 and URL-safe Base64?
Standard Base64 uses + and / characters which have special meaning in URLs. URL-safe Base64 replaces + with - and / with _ so the output can be safely used in URLs and filenames without percent-encoding.
Why does my Base64 string end with = or ==?
The = characters are padding. Base64 encodes 3 bytes at a time into 4 characters. If the input length isn't divisible by 3, padding is added to make the output a multiple of 4 characters.