What is Base64 Encoder / Decoder?

Free Base64 encoder and decoder. Encode text or files to Base64 and decode Base64 strings back to text. Supports file to data URI encoding. No signup required.

No file uploadsNo tracking of inputsNo account requiredWorks offline after first load

Base64 runs entirely in your browser using Web Crypto API. Your data never leaves your device.

Free Base64 Encoder / Decoder

Encode any text string or file to Base64 and decode Base64 strings back to readable text. Convert images and files to Base64 data URIs for embedding in HTML, CSS, or JSON. URL-safe Base64 mode included. All processing happens entirely in your browser — your data never leaves your device.

Free to embed on your website · No signup required

🔢

Text & files

Encode any text string or file (images, documents, any format) to Base64.

🔗

URL-safe mode

Replaces + and / with - and _ for safe use in URLs and filenames.

🔒

100% private

All encoding and decoding happens in your browser — nothing is uploaded.

Frequently Asked Questions

Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). It is used to safely transmit binary data (images, files) through text-based protocols like HTTP headers, email (MIME), and JSON.
Base64 encodes 3 bytes of binary data into 4 ASCII characters, making the output approximately 33% larger than the original. This size increase is the trade-off for making binary data safe to include in text formats.
Standard Base64 uses + and / which have special meanings in URLs. URL-safe Base64 replaces + with - and / with _, making the encoded string safe to use in URLs and filenames without percent-encoding.
A data URI is a way to embed file content directly in HTML or CSS. Format: data:[mediatype];base64,[encoded-data]. For example, you can embed a small PNG image directly in an <img> src attribute without a separate file.
No. Base64 is encoding, not encryption. Anyone can instantly decode a Base64 string — it provides no security. Do not use Base64 to "hide" passwords or sensitive data.
Base64 is everywhere in web development: HTTP Basic Authentication encodes "username:password" in Base64 in the Authorization header. JSON Web Tokens (JWTs) use URL-safe Base64 for the header and payload. Email attachments are Base64-encoded by the MIME standard. CSS embed inline fonts and SVG icons using data URIs. API responses from some services (Google Vision, AWS) return images as Base64 strings.
Yes. Switch to File mode and select any file from your device — images, PDFs, documents, archives. The encoder reads the raw bytes and outputs a Base64 string. The file-to-data-URI feature generates the full data:mediatype;base64,... string ready to embed in HTML or CSS. Note that Base64-encoded files are 33% larger than the originals, so embedding large files as data URIs will increase page weight.

When and Why Base64 Is Used

Base64 is used wherever binary data needs to travel through a text-only channel. The most common cases are: embedding images directly in HTML or CSS as data URIs (avoiding an extra HTTP request for small icons and SVGs), encoding binary data in JSON API payloads (since JSON only supports Unicode text), transmitting file attachments in email (MIME attachments are Base64-encoded), storing binary data in text-only databases, encoding credentials in HTTP Basic Authentication headers, and representing binary data in JWTs (JSON Web Tokens).

Base64 vs URL Encoding

Base64 and URL encoding (percent-encoding) both represent non-ASCII or binary data as ASCII text, but serve different purposes. Base64 encodes arbitrary binary data as a compact string using 64 printable characters. URL encoding specifically escapes characters that are unsafe in URLs — spaces become %20, equals signs become %3D, etc. URL-safe Base64 bridges both: it uses the standard Base64 alphabet but replaces + with - and / with _, so the result can appear in a URL without further encoding. This is the variant used in JWTs and OAuth tokens.

How Base64 Encoding Works Technically

Base64 groups the input bytes into sets of 3 bytes (24 bits) and maps each 6-bit chunk to one of 64 characters (A–Z, a–z, 0–9, +, /). This means every 3 bytes become 4 characters — a 33% overhead. If the input length is not a multiple of 3, padding characters (=) are added to make the output a multiple of 4 characters. The resulting string contains only printable, non-whitespace ASCII characters that are safe in any text-based system.

Base64 Is Not Encryption

Base64 provides encoding, not security. Any Base64 string can be decoded instantly by anyone — there is no key, no password, and no computational difficulty involved. It is a reversible transformation. Never use Base64 as a way to obscure or protect sensitive data like passwords, API keys, or personal information. For security, use encryption (AES, RSA) or hashing (bcrypt for passwords, SHA-256 for data integrity). Base64 in a JWT, for example, simply means the payload is encoded for transmission — the token must be validated with a signature to confirm authenticity.