About Base64 Encoder/Decoder
Encode and decode Base64 for text strings, file uploads (with data URI output), and image preview. Supports standard and URL-safe Base64 variants (replaces + with - and / with _). Three modes: text encode/decode, file encode, and image preview.
Base64 Encoding
Converts binary data to ASCII text using 64 characters (A-Z, a-z, 0-9, +, /). Used for embedding binary data in text-based formats like JSON, XML, HTML, and email.
URL-Safe Base64
Replaces + with - and / with _ so the output can be safely used in URLs and filenames without percent-encoding. No padding (=) issues. Commonly used in JWTs, OAuth tokens, and API keys.
File Encoding
Upload any file (image, PDF, document) and get its Base64 representation. Output includes data URI format (data:image/png;base64,...) for direct use in HTML/CSS.
Image Preview
When decoding Base64 that represents an image, the tool automatically shows a preview. Useful for verifying image data before using in applications.
Common Use Cases
Email attachments: MIME encoding. API authentication: Basic Auth headers (username:password encoded). Data URLs: Embed images in HTML/CSS. JWT tokens: URL-safe Base64 for header and payload. Database storage: Store binary data as text.