Base64 Encoder / Decoder - Convert Text and Data to Base64
Encode and decode Base64 strings directly in your browser. Supports UTF-8 text and URL-safe Base64. Fully client-side processing — no data is sent to a server. Essential developer tool for working with APIs, JWT tokens and data URLs.
Note:All generated data is entirely fictional and not suitable for use as real personal information.
What is Base64 encoding?
Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters: A–Z, a–z, 0–9, + and / (with = as padding). Every 3 bytes of input produce exactly 4 Base64 characters, resulting in a roughly 33% size increase compared to the original data.
The encoding works by taking 3 bytes (24 bits) of input, splitting them into four 6-bit groups, and mapping each group to one of the 64 Base64 characters. This process makes binary data safe to transmit over channels that only support text.
Common use cases for Base64
- Data URIs — Embed images, fonts or other binary assets directly in HTML/CSS as
data:image/png;base64,.... Eliminates extra HTTP requests. - HTTP Basic Authentication — The
Authorization: Basicheader carries Base64-encoded credentials in the formatusername:password. - JWT tokens — JSON Web Tokens use URL-safe Base64 (Base64url) to encode the header and payload sections.
- Email attachments — MIME email attachments are Base64-encoded to safely transmit binary files over SMTP.
- API payloads — Binary data such as images or PDFs sent via REST APIs is often Base64-encoded to fit in JSON strings.
Base64 vs URL-safe Base64
Standard Base64 uses + and / characters, which have special meaning in URLs. URL-safe Base64 (Base64url, used in JWT and OAuth) replaces these with - and _, and typically omits the trailing = padding. Use the URL-safe variant when working with OAuth tokens, JWTs, or when embedding encoded data in query parameters.
Base64 is encoding, not encryption
Base64 provides no security— it is trivially reversible by anyone who sees the encoded string. Never use Base64 to “secure” sensitive data such as passwords or API keys. For security, use proper hashing (bcrypt, Argon2) or encryption (AES). Base64 is purely a data transport format.