Base64 Encoder & Decoder
Encode text to Base64 or decode Base64 back to text. Supports UTF-8 and URL-safe variants.
How it works: Encode converts normal text into Base64 format (used in APIs, emails, and data URIs). Decode converts Base64 back to readable text. Paste your text on the left and see the result on the right.
What is Base64?
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 widely used to safely transmit binary data over channels that only support text, such as email (MIME), JSON payloads, and HTML data URIs.
How Base64 Encoding Works
Base64 encodes every 3 bytes of input data into 4 ASCII characters. The output is always a multiple of 4 characters, padded with = signs if necessary. This means Base64-encoded data is approximately 33% larger than the original. Decoding reverses the process exactly, recovering the original binary data.
URL-Safe Base64
Standard Base64 uses + and / characters that have special meanings in URLs. URL-safe Base64 (also called Base64url) replaces + with - and / with _, making the output safe to use directly in URLs and filenames without percent-encoding. It is commonly used in JWT tokens and OAuth flows.
Common Use Cases
- Embedding images in HTML/CSS as data URIs
- Encoding binary data in JSON APIs
- Basic data obfuscation (not encryption)
- JWT token payloads
- Email attachments (MIME encoding)
- Storing binary data in text-only formats