Encode any text or file to Base64, or decode a Base64 string back to plain text instantly. This free online Base64 encoder supports both standard and URL-safe Base64 encoding formats (RFC 4648). Paste your text, drag and drop a file, or switch to decode mode to convert Base64 back to readable content. All processing happens entirely in your browser using native JavaScript APIs — nothing is ever uploaded to a server. Works offline, no signup required.
Base64 lets you transport binary data through text-only channels — JSON payloads, JWT tokens, email attachments, data URIs in HTML/CSS. The tool runs entirely in your browser, so even sensitive payloads (API keys, certificates, customer files) never reach a server.
+///= with -/_/(none).+///= vs -/_/(none). A URL-safe encoder can't decode standard Base64 without conversion.= padding to multiple of 4. Some implementations strip it; some require it. When in doubt, add it back.data: URIs. Anything > 10KB is faster as a regular HTTP request. Inline encoding only for tiny icons and inline emails.data: URIs, and HTML src attributes for images. It inflates data size by about 33%.
=) are appended to make the output length a multiple of 4. One = means 1 padding byte was added; == means 2 bytes. Padding is sometimes stripped in URL-safe variants.
+ and /, which are reserved characters in URLs. URL-safe Base64 (RFC 4648) replaces + with - and / with _, making it safe to include in URLs and filenames without percent-encoding. JWT tokens use URL-safe Base64 without padding.
FileReader: const reader = new FileReader(); reader.onload = e => console.log(e.target.result); reader.readAsDataURL(file); — this gives you a full data URI including the MIME type prefix. To get just the Base64 string, split on the comma: e.target.result.split(',')[1].
btoa, atob, and FileReader). No data, text, or files are ever uploaded to a server. The tool works fully offline once loaded.