Base64 Encoding: What It Is, What It Isn't, and When to Use It
Base64 is everywhere in web development — in JWTs, data URIs, API tokens, and email attachments. Here's a clear explanation of how it works and common misconceptions.
Encode and decode text, files and images
Encode or decode Base64 online — text, files and images. Supports standard and URL-safe Base64 variants, Unicode strings and drag-and-drop file input. Instant results, 100% client-side, zero data sent to any server.
Base64 is a binary-to-text encoding scheme that converts arbitrary binary data into a string of 64 printable ASCII characters. It exists because many protocols — email, HTTP headers, JSON payloads — were designed to carry text, not raw binary. When you need to embed an image in an HTML document, include a PDF in a JSON API response, or store a binary token in a cookie, Base64 provides a reliable, universally-supported encoding.
Understanding what Base64 is not is equally important: it is not encryption. Anyone can decode a Base64 string in milliseconds without any secret key. The encoded output looks like random characters but contains no security — never use Base64 to protect sensitive data.
How to use this tool:
+ and / characters. URL-Safe Base64 replaces those with - and _, which is required when embedding Base64 inside URLs or JWT tokens.Where you will see Base64 in practice:
data:image/png;base64,...Authorization: Basic <base64(username:password)>All encoding and decoding in this tool runs in your browser via WebAssembly — no files or text are uploaded to any server.
Base64 is used to encode binary files (like images, documents, or audio) into text so they can be embedded directly in HTML, CSS, XML, or JSON, and transmitted securely over systems that do not support raw binary data.
No. Base64 is not encryption. It is a simple encoding format. Anyone can easily decode a Base64 string back to its original text or binary form. Never use Base64 to secure sensitive credentials without proper encryption.
Standard Base64 uses '+' and '/' characters, which have special meanings in URLs. URL-Safe Base64 replaces '+' with '-' and '/' with '_', making it safe to use in query parameters and URL paths without additional percent-encoding.
There is no hard limit, but since the encoding is processed entirely inside your browser's memory, files larger than 50MB may temporarily freeze the browser tab. We recommend keeping files under 20MB for the best experience.
Base64 encodes 3 bytes at a time into 4 characters. When the input length is not divisible by 3, padding characters (=) are added to make the output a multiple of 4 characters. One = means 1 padding byte was needed; == means 2 were needed.