How to use the Base64 Encoder
Encode text to Base64 in three steps:
1
Paste your text
Paste any plain text, Unicode string, or binary-safe content into the input area.
2
Choose encoding mode
Select Standard Base64 (RFC 4648) or URL-safe Base64 (replaces + with - and / with _ for use in URLs and JWT). Toggle MIME line-wrapping at 76 characters if required.
3
Copy the encoded output
The Base64-encoded string appears instantly. Copy or download. The footer shows encoded length and size overhead percentage.
When to use this tool
Use Base64 encoding whenever you need to represent binary or text data as ASCII-safe characters:
- →Encoding binary file content or binary strings to embed safely in JSON, XML, or YAML payloads
- →Preparing text or data to embed as a data URI in HTML or CSS (e.g. inline images or fonts)
- →Encoding credentials for HTTP Basic Authentication headers (username:password → Base64)
- →Creating JWT token payloads that require Base64url encoding of the header and claims sections
- →Encoding attachment content in MIME email messages where the Content-Transfer-Encoding is Base64
- →Passing binary data through systems that only support ASCII text, such as older APIs and messaging protocols
Frequently asked questions
Q:What is Base64 encoding?
Base64 is an encoding scheme that converts binary or text data into a string of 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). It is not encryption — it carries no secret and anyone can decode it. Base64 exists to safely transport arbitrary data through systems that only handle plain text, such as email (MIME), HTML data URIs, and HTTP headers. The encoded output is approximately 33% larger than the original.
Q:What is the difference between Standard and URL-safe Base64?
Standard Base64 (RFC 4648) uses the characters + and / which have special meaning in URLs (+ means space, / is a path separator). URL-safe Base64 (Base64url) replaces + with - and / with _ so the encoded string can be used directly in URLs, query parameters, and JWT tokens without percent-encoding. The padding character = is sometimes also omitted in URL-safe mode.
Q:What does MIME line-wrapping do?
MIME (email) standards require Base64-encoded content to be broken into lines of at most 76 characters, each terminated by a CRLF (\r\n). Toggle 'MIME line-wrapping' to produce output formatted this way — required when embedding Base64 in email Content-Transfer-Encoding: base64 headers. For data URIs, JWT, or API use, line-wrapping should be disabled as it would break the encoded string.
Q:Why is Base64 output about 33% larger than the input?
Base64 encodes every 3 bytes of input into 4 ASCII characters. Three bytes = 24 bits; four Base64 characters = 24 bits represented in 4 × 8 = 32 ASCII bits. The ratio is 4/3 ≈ 1.333, so every 3 bytes becomes 4 characters — a 33% size increase. Padding characters (=) may add 0, 1, or 2 extra characters to make the output length a multiple of 4.
Q:Can I encode Unicode or emoji characters?
Yes — the encoder first converts the input to UTF-8 bytes, then Base64-encodes those bytes. This means any Unicode character, including emoji, CJK characters, Arabic, and other multi-byte scripts, is handled correctly. The decoder must also use UTF-8 interpretation to correctly recover the original Unicode text.
Q:Is Base64 the same as encryption?
No — Base64 is encoding, not encryption. It transforms data into a different representation but provides zero security or confidentiality. Any Base64 string can be instantly decoded by anyone with a Base64 decoder. Never use Base64 to protect sensitive data. For security, use proper encryption (AES, RSA) or hashing (SHA-256, bcrypt) rather than encoding.