Base64 Encoder & Decoder
Encode plain text or binary data to Base64 and decode Base64 strings back to readable text instantly. Supports standard Base64, URL-safe Base64, and file encoding. Used everywhere from HTTP Basic Auth headers to embedding images inline in HTML and CSS. All conversions are performed locally in your browser.
What is Base64?
Base64 is a binary-to-text encoding scheme that represents binary data using a set of 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). It converts every 3 bytes of binary data into 4 characters, increasing size by approximately 33%.
Base64 is not encryption — it is encoding. Anyone can decode a Base64 string without a key. Its purpose is to safely transmit binary data through systems that only support text, such as email (MIME), HTTP headers, and JSON payloads.
Standard vs URL-Safe Base64
Standard Base64: Uses + and / characters. Output may use = padding. Used in email (MIME) and file transfers.
URL-safe Base64: Replaces + with - and / with _. Safe to use directly in URLs without percent-encoding. Used in JWTs and OAuth tokens.
Data URIs: Uses standard Base64 with a MIME prefix, e.g. data:image/png;base64,...
Tips & Tricks
- Encode HTTP Basic Auth as
username:password→ Base64 - JWTs use URL-safe Base64 without
=padding - Embed small images in CSS using
data:URIs - Base64 adds ~33% size overhead — not suitable for large files
- Base64 is NOT encryption — anyone can decode it
Common Base64 Use Cases
HTTP Auth
Encode username:password for HTTP Basic Authentication headers.
Data URIs
Embed small images or fonts directly in HTML/CSS without a separate file request.
API Payloads
Encode binary data for transmission in JSON API payloads.
Email (MIME)
Encode attachments and binary content in MIME email messages.
Frequently Asked Questions
Related Tools
Understanding Base64 Encoding in Web Development
Base64 encoding is one of the most fundamental data transformation techniques in computing. Defined by RFC 4648, it converts arbitrary binary data into a safe, printable ASCII representation using a 64-character alphabet. This makes it indispensable for transmitting binary content through channels designed only for text — such as email (MIME), HTTP headers, JSON payloads, and URL query parameters. While Base64 is not encryption and provides zero security, it solves a critical interoperability problem: safely moving binary data through text-only systems without corruption or data loss.
Where Base64 Is Used Every Day
Every time you send an email with an attachment, the file is Base64-encoded inside the MIME message. Every JSON Web Token (JWT) you see in an authentication header is three Base64URL-encoded segments. Every inline image in a CSS stylesheet using a data: URI is Base64-encoded. HTTP Basic Authentication headers encode the username:password pair in Base64 before transmission. Understanding Base64 is essential for debugging authentication flows, inspecting network requests, and working with APIs that accept or return binary data in text form. The 33% size overhead is the trade-off — every 3 bytes of input become 4 Base64 characters — which is acceptable for small payloads but inefficient for large file transfers.
Standard vs URL-Safe Base64
The distinction between standard and URL-safe Base64 trips up many developers. Standard Base64 uses + and / characters which have special meaning in URLs and file paths. URL-safe Base64 (Base64url, per RFC 4648 Section 5) replaces these with - and _, and often omits the = padding. JWTs, OAuth tokens, and URL-embedded parameters all use URL-safe Base64. Our tool supports both variants and automatically detects the format. For inspecting JWT tokens, use our JWT Decoder. For encoding URL parameters, see the URL Encoder. Generate secure credentials with the Password Generator or unique IDs with the UUID Generator. Explore all utilities on the homepage or learn more about DailyUtil.