Base64 Encode

Encode any text or data to Base64 format instantly — free, fast, runs in your browser.

What is Base64 Encoding?

Base64 is a binary-to-text encoding scheme that represents binary data using only 64 printable ASCII characters: A–Z, a–z, 0–9, + and /. The name "Base64" comes from the fact that 64 is the largest power of 2 that can be represented using only printable ASCII characters.

Base64 encoding is widely used across software development and internet infrastructure. It is used to embed images directly in HTML and CSS as data URIs, encode binary email attachments in MIME format, transmit binary data through JSON APIs that only support text, store credentials in HTTP Basic Authentication headers, and encode cryptographic keys and certificates in PEM format.

The encoding works by taking 3 bytes (24 bits) of input and splitting them into four 6-bit groups. Each 6-bit value is mapped to one of the 64 Base64 characters. If the input length is not a multiple of 3, padding characters (=) are appended to make the output length a multiple of 4.

URL-safe Base64 replaces + with - and / with _ to make the encoded string safe for use in URLs and filenames without percent-encoding. This variant is commonly used in JWT tokens, OAuth flows, and URL parameters.

This free Base64 encoder runs entirely in your browser — your data is never sent to any server. It supports Unicode text including emojis and non-Latin characters by using UTF-8 encoding internally.

Frequently Asked Questions

Does Base64 encoding encrypt my data?
No. Base64 is an encoding scheme, not encryption. It is trivially reversible by anyone — just paste the Base64 string into a decoder. Do not use Base64 to protect sensitive data. Use proper encryption (AES, RSA) for security.
Why does Base64 output end with == or =?
Base64 encodes 3 bytes at a time. If the input length isn't a multiple of 3, padding characters (=) are added to make the output length a multiple of 4. One = means 1 padding byte was needed, == means 2 padding bytes were needed.
How much larger is Base64 output vs input?
Base64 output is approximately 33% larger than the input — every 3 bytes of input produces 4 bytes of output. This overhead is the trade-off for making binary data safe to transmit as text.
What is URL-safe Base64?
Standard Base64 uses + and / which have special meanings in URLs. URL-safe Base64 (Base64url) replaces + with - and / with _ so the encoded string can be used directly in URLs and filenames. JWT tokens use URL-safe Base64.
Can I encode binary files with this tool?
This tool encodes text input. To encode binary files (images, PDFs) to Base64, use the Image to Base64 tool which accepts file uploads and handles binary data correctly.