Instantly encode text to Base64 or decode Base64 to readable text. Supports URL-safe Base64 and file encoding. Your data never leaves your browser.
Base64 is an encoding scheme that converts binary data (images, files, bytes) into a string of 64 printable ASCII characters. It is used in: email attachments (MIME encoding), embedding images in HTML/CSS as data URIs, storing binary data in JSON payloads, HTTP Basic Authentication headers (credentials encoded as base64), and JWT (JSON Web Tokens). Base64 increases data size by about 33%, so it is used for compatibility, not compression.
Standard Base64 uses characters A-Z, a-z, 0-9, +, and /. The + and / characters are not URL-safe and must be percent-encoded in URLs (%2B and %2F). URL-safe Base64 (Base64url) replaces + with - and / with _, making the encoded string safe to use in URLs and filenames without percent encoding. JWTs use URL-safe Base64. For HTTP headers and URLs, always use URL-safe Base64.
In JavaScript, use atob() to decode Base64 to a string and btoa() to encode: const encoded = btoa('Hello World'); // SGVsbG8gV29ybGQ= const decoded = atob('SGVsbG8gV29ybGQ='); // Hello World. For Node.js: Buffer.from('Hello World').toString('base64') to encode, and Buffer.from(encoded, 'base64').toString('utf8') to decode. For binary files, use Buffer.from(base64String, 'base64') to get the file bytes.
To embed a Base64 image in HTML, use the data URI format: <img src="data:image/png;base64,YOUR_BASE64_HERE">. Replace image/png with the correct MIME type (image/jpeg, image/gif, image/svg+xml etc). This approach avoids a separate HTTP request, improving performance for small icons. However, for large images, Base64 significantly increases page size — use it only for small icons or when a separate request is undesirable.
No. Base64 is encoding, not encryption. Anyone can decode Base64 instantly without a key or password. Base64 offers zero security. It is used for encoding binary data to text-safe format, not for securing data. If you need to secure sensitive data, use actual encryption algorithms like AES-256. Never use Base64 as a security measure — for example, do not store Base64-encoded passwords thinking they are hidden.