Encode or decode Base64 strings and files instantly. Supports text, URLs, and binary files — 100% in your browser. Nothing leaves your device.
// updated April 2026Base64 is an encoding scheme that converts binary data into ASCII text using 64 printable characters. It's widely used to transmit binary data over systems that handle text, like email or URLs.
Features:
Base64 encoding converts binary data into a set of 64 ASCII characters (A–Z, a–z, 0–9, +, /). Each 3 bytes of binary data becomes 4 Base64 characters, making encoded output about 33% larger than the original.
Base64 is not encryption — it's purely an encoding scheme. Anyone can decode it. Read our full guide: what is Base64? and the comparison: Base64 vs hex encoding.
Standard Base64 uses + and / which have special meaning in URLs. URL-safe Base64 replaces these with - and _.
JWT tokens use URL-safe Base64 without padding for the header and payload sections. See our JWT Decoder to decode JWT tokens directly.
btoa(string) for ASCII strings. For Unicode text use: btoa(unescape(encodeURIComponent(string))). To decode, use atob(base64string). Read the full guide: encode images to Base64 in JavaScript.base64 module: import base64; base64.b64encode(b"Hello World"). To decode: base64.b64decode("SGVsbG8gV29ybGQ="). For URL-safe Base64 use base64.urlsafe_b64encode().<img src="data:image/png;base64,YOUR_BASE64_HERE">. This embeds the image directly in your HTML without a separate file request. See our guide: encode images to Base64.