Base64 Encoder / Decoder
Encode text or files to Base64, or decode Base64 back to plain text. Supports URL-safe Base64 and file-to-Base64 conversion.
Common Base64 Use Cases
Embed Image in HTML/CSS
Convert image files to Base64 data URLs to embed them directly in HTML img tags or CSS background-image properties โ no separate file request.
data:image/png;base64,iVBORw0โฆ
HTTP Basic Auth Header
HTTP Basic Authentication encodes credentials as Base64 in the Authorization header. The format is Base64("username:password").
Authorization: Basic dXNlcjpwYXNz
JWT Token Payload
JSON Web Tokens (JWT) use URL-safe Base64 encoding (Base64url) for the header and payload segments, separated by dots.
eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiโฆ
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 transmit binary data over channels that only support text, such as email (MIME), JSON APIs, and HTML attributes.
Standard Base64 uses + and / characters, which have special meaning in URLs. URL-safe Base64 (Base64url) replaces + with - and / with _, making the output safe to include in URLs and HTTP headers without percent-encoding. JWT tokens use Base64url encoding.
Base64 encodes every 3 bytes of input as 4 ASCII characters (a 4/3 ratio). This means Base64 output is always approximately 33% larger than the original binary data. Padding characters (=) are added to make the output length a multiple of 4.
No. Base64 is an encoding scheme, not encryption. It is trivially reversible โ anyone can decode Base64 without a key. It is used for format compatibility, not security. Never use Base64 to hide sensitive data.
Related Calculators
URL Encoder/Decoder
Encode and decode URLs, query strings, and special characters.
JSON Formatter
Format, validate, minify, and convert JSON to YAML or CSV.
Hash Generator
Generate MD5, SHA-1, SHA-256, and SHA-512 hashes from any text.