Encode text to Base64 or decode Base64 back to plain text instantly. Supports Unicode, URL-safe encoding, and file-to-data-URI conversion -- all client-side. Your data never leaves your browser.
Drag & drop a file here, or click to browse
Max file size: 5 MB. Output will be a data URI.
Type or paste text and see the Base64 encoding update in real time. Switch between encode and decode modes with a single click. All processing happens locally in your browser.
Properly handles multi-byte Unicode characters including emoji, CJK characters, and accented letters using TextEncoder/TextDecoder for accurate encoding and decoding.
Encode with URL-safe Base64 (RFC 4648 section 5), which replaces + with -, / with _, and strips padding. Ideal for URLs, filenames, and query parameters.
Drag and drop or browse to select any file (up to 5 MB). The tool encodes it as a complete data URI, ready to embed in HTML, CSS, or JSON.
Base64 is a binary-to-text encoding scheme that represents binary data using a set of 64 ASCII characters. Defined in RFC 4648, Base64 is widely used to embed binary data in text-based formats like HTML, CSS, JSON, XML, and email (MIME). The encoding uses the characters A-Z, a-z, 0-9, +, and /, with = used for padding.
Base64 encoding takes every three bytes of input and converts them into four ASCII characters. Each group of 6 bits maps to one of the 64 characters in the Base64 alphabet. If the input length is not a multiple of three, padding characters (=) are appended to the output. This means Base64-encoded data is always about 33% larger than the original binary data.
Standard Base64 uses + and / as the 62nd and 63rd characters, with = for padding. URL-safe Base64 (RFC 4648 section 5) replaces + with - and / with _, and typically omits padding. This variant is used in URLs, filenames, cookies, and JWT tokens where + and / would need percent-encoding.
data:[mediatype];base64,[data]. For example, a small PNG image can be embedded as data:image/png;base64,iVBORw0KGgo... directly in an <img> tag's src attribute or in a CSS background-image property. Data URIs eliminate the need for separate HTTP requests, which can improve performance for small files. However, they increase the document size due to Base64 overhead and bypass browser caching, so they are best suited for small assets like icons and simple graphics.
Check out our other free developer tools. Decode JWTs, format JSON, parse cron expressions, and more -- all from your browser with no sign-up required.
JWT Decoder →