Base64 Encode & Decode Online
Convert text to Base64 encoding and vice versa. Useful for encoding binary data as ASCII text.
▶About Base64 Encoding
Base64 is a binary-to-text encoding scheme that represents binary data as printable ASCII characters. It uses a 64-character alphabet (A-Z, a-z, 0-9, +, /) to encode every 3 bytes of input into 4 output characters, with = padding when needed.
This free online Base64 encoder and decoder converts text to Base64 and back instantly. It supports full UTF-8 encoding, so Chinese, Japanese, emoji, and other multi-byte characters are handled correctly.
Common use cases: encoding binary data for embedding in JSON or XML, creating data URIs for inline images in HTML/CSS, encoding email attachments (MIME), passing binary payloads through text-only protocols, and decoding Base64 strings from API responses or JWTs.
▶Base64 Code Examples
▶JavaScript / Node.js
// Encode
const encoded = btoa(unescape(encodeURIComponent("Hello 🌍")));
// Decode
const decoded = decodeURIComponent(escape(atob(encoded)));▶Python
import base64
# Encode
encoded = base64.b64encode("Hello 🌍".encode("utf-8")).decode()
# Decode
decoded = base64.b64decode(encoded).decode("utf-8")▶Go
import "encoding/base64"
// Encode
encoded := base64.StdEncoding.EncodeToString([]byte("Hello"))
// Decode
decoded, _ := base64.StdEncoding.DecodeString(encoded)▶Bash / cURL
# Encode
echo -n "Hello" | base64
# Decode
echo "SGVsbG8=" | base64 --decode▶Frequently Asked Questions
▶What is Base64 encoding?
Base64 is a binary-to-text encoding scheme that converts binary data into a set of 64 printable ASCII characters (A-Z, a-z, 0-9, +, /). It is commonly used to embed binary data in text formats like JSON, XML, HTML, and email.
▶How do I encode text to Base64?
Paste your text into the input field and select Encode. The Base64 output will appear instantly. You can then copy it with one click.
▶Does Base64 encoding keep my data private?
No. Base64 is an encoding, not encryption. Anyone can decode a Base64 string. If you need to protect sensitive data, use proper encryption before encoding.
▶Why is my Base64 string longer than the original?
Base64 encoding increases data size by approximately 33% because it represents every 3 bytes of input as 4 ASCII characters. This is a trade-off for safe text transport.