What is Base64?
Base64 is a way of writing binary data using only 64 safe characters: A–Z, a–z, 0–9, plus + and /, with = as padding. Many systems were designed to carry text, not raw bytes – email, JSON, XML, URLs, HTML attributes and HTTP headers among them. Base64 lets you send images, files, keys and other binary content through those channels without it getting corrupted. Every 3 bytes of input become 4 characters of output, so Base64 data is about 33% larger than the original.
Base64 is encoding, not encryption
Anyone can decode Base64 instantly – this tool is proof. Never use it to hide passwords or secrets. It only changes the representation of data, not its secrecy. Use real encryption when you need privacy.
Common uses
- Data URIs: embed small images or fonts directly in HTML or CSS, like
data:image/png;base64,…. - APIs and JSON: send file contents or binary values inside JSON fields.
- HTTP Basic authentication: the
Authorizationheader carriesusername:passwordin Base64. - JSON Web Tokens (JWT): the header and payload are Base64URL-encoded. Paste one part with URL-safe mode on to read it.
- Email attachments: MIME encodes attachments in Base64, wrapped at 76 characters per line.
UTF-8 and URL-safe Base64
The browser’s basic Base64 functions only handle Latin-1 characters and fail on emoji or non-English text. This tool first converts text to UTF-8 bytes, so “café ☕” or “こんにちは” encode and decode correctly. URL-safe Base64 (also called Base64URL, defined in RFC 4648) replaces + with - and / with _ and usually drops the = padding, so the result can sit in a URL or file name without extra escaping. When decoding, both variants are detected automatically, and whitespace and line breaks are ignored.