Encode any text to Base64 or decode a Base64 string back to plain text. Supports Unicode, URL-safe mode, and runs entirely in your browser.
Base64 is an encoding scheme that converts binary or text data into a string of ASCII characters using a 64-character alphabet (A–Z, a–z, 0–9, +, /). It was originally designed to safely transmit binary data through systems that only handle text — such as email (MIME), HTTP headers, and XML documents.
Base64 is not encryption. Anyone can decode a Base64 string instantly — it provides no confidentiality. It is purely a way to represent data in a text-safe format.
src="data:image/png;base64,..." to avoid extra HTTP requests.Standard Base64 uses + and / characters, which have special meanings in URLs. URL-safe Base64 (Base64url) replaces + with - and / with _, and typically omits the padding = characters. This variant is used in JWTs, Google's APIs, and any context where Base64 data appears in a URL.
Every 3 bytes (24 bits) of input become 4 Base64 characters (6 bits each). If the input length is not divisible by 3, padding characters (= or ==) are added to reach the nearest 4-character boundary. This means Base64-encoded output is always about 33% larger than the original input.
Standard btoa() in browsers only handles Latin-1 characters. To correctly encode Unicode text (emojis, accented characters, Chinese, etc.), this tool first converts the text to UTF-8 bytes using TextEncoder before encoding. This ensures all characters are handled correctly.