data:image/png;base64,...), MIME type is auto-filled.
Standard uses A–Z a–z 0–9 + / with = padding.
URL-safe replaces +→- and /→_, and omits padding.
Every 3 bytes of input produce 4 Base64 characters (~33% size increase).
Our free Base64 Encoder / Decoder converts text or binary files to Base64 and back — instantly in your browser. No upload to a server, no signup, no size limits imposed by the server. Ideal for developers who need to embed images in CSS or HTML, pass binary data in JSON APIs, or inspect encoded strings during debugging.
Base64 is a binary-to-text encoding scheme that represents binary data as an ASCII string using 64 printable characters (A–Z, a–z, 0–9, +, /) with = as padding. It is defined in RFC 4648. Every 3 bytes of input are encoded as 4 characters, which means Base64 output is approximately 33% larger than the original data.
This tool fully supports Unicode text, including characters from any language, emoji, and symbols. Internally, text is first converted to UTF-8 bytes before Base64 encoding, which is the correct and portable approach. When decoding, the UTF-8 byte sequence is reconstructed from the Base64 string and then decoded back to its Unicode representation.
Switch to File mode to upload any file and convert it to a Base64 string. This is commonly used to embed images directly in CSS (background-image: url("data:image/png;base64,...")) or HTML (<img src="data:image/jpeg;base64,...">), eliminating additional HTTP requests. You can also paste a data URI or raw Base64 string and download the decoded file.
Standard Base64 uses + and / which are not safe in URLs and query strings. URL-safe Base64 (RFC 4648 §5) replaces + with - and / with _, and omits the = padding. It is used in JWT tokens, URL parameters, and other web contexts where the standard alphabet would require percent-encoding.
When you select Auto-detect, the tool examines the input and decides whether it looks like a Base64 string (and should be decoded) or plain text (and should be encoded). The heuristic tries to decode the input as Base64, then checks whether the result is readable text. If both conditions pass, it decodes; otherwise it encodes. For unambiguous results, select Encode or Decode explicitly.