What is Base64?
Base64 is an encoding scheme that converts binary data into a text representation using 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). It was designed to safely transmit binary data — such as images, files, or cryptographic keys — through systems that were originally built to handle only plain text, such as email (MIME) or XML.
Base64 is not encryption. It does not protect your data — anyone can decode it instantly. It is purely a way to represent binary data as text so it can travel through text-based protocols without corruption.
How to Use This Tool
- Select Encode or Decode using the toggle at the top.
- Paste your text into the left input box. The result appears in real time on the right.
- Click Use output as input to flip the result back into the input and switch modes — useful for round-trip testing.
- Click Copy output to copy the result to your clipboard.
Unicode Support
Standard Base64 in browsers only handles ASCII characters natively. This tool uses TextEncoder and TextDecoder to fully support Unicode — including emojis, Arabic, Chinese, Japanese, and all other non-ASCII characters. You can safely encode and decode any UTF-8 text.
Common Use Cases
- Embedding images in HTML or CSS — Data URLs use Base64 to embed image data directly in HTML (
src="data:image/png;base64,...") or CSS (background-image: url(...)), eliminating separate HTTP requests. - API authentication — HTTP Basic Auth sends credentials as
Base64(username:password)in the Authorization header. - JWT tokens — JSON Web Tokens use Base64URL (a variant of Base64) to encode their header and payload sections.
- Email attachments — The MIME standard uses Base64 to encode file attachments so they can be sent safely through email servers.
- Storing binary data in JSON — Since JSON only supports text, binary data like images or cryptographic keys is often Base64-encoded before being stored in a JSON field.
Frequently Asked Questions
Is Base64 the same as encryption?
No. Base64 is encoding, not encryption. It is completely reversible and provides no security whatsoever. Anyone who receives a Base64 string can decode it instantly. If you need to protect data, use proper encryption like AES or RSA — not Base64.
Why does Base64 output end with = or ==?
Base64 encodes every 3 bytes of input into 4 characters. If the input length isn't divisible by 3, padding characters (=) are added to make the output length a multiple of 4. One = means one byte of padding; == means two bytes of padding.
What is Base64URL?
Base64URL is a variant of Base64 that replaces + with - and / with _, and omits padding. This makes the output safe to use in URLs and filenames without percent-encoding. JWT tokens use Base64URL for their header and payload. This tool uses standard Base64, not Base64URL.
Does it work offline?
Yes. All encoding and decoding happens in your browser using the built-in btoa(), atob(), TextEncoder, and TextDecoder APIs. No internet connection is required after the page loads.