// encode text or files to base64 · decode base64 strings · url-safe mode · nothing leaves your browser
Base64 is a binary-to-text encoding scheme that converts binary data into ASCII characters. It's widely used to transmit data over systems that only support text — like embedding images in HTML/CSS, encoding credentials in HTTP headers, or storing binary data in JSON.
The name "Base64" comes from the 64 characters used in the encoding: A–Z, a–z, 0–9, +, and /.
+ with - and / with _Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters: A-Z, a-z, 0-9, plus (+) and slash (/). Every 3 bytes of binary input become 4 Base64 characters, which is why Base64 output is always about 33% larger than the original data.
The encoding was invented to solve a fundamental problem: many systems were designed to handle text but not arbitrary binary data. Email protocols, HTTP headers, and XML documents all have restrictions on what characters they can contain. Base64 converts any binary data into a safe subset of ASCII that can pass through these systems without corruption.
Common real-world uses include embedding images directly in HTML or CSS using data URIs, encoding credentials in HTTP Basic Authentication headers, storing binary data in JSON or XML, transmitting cryptographic keys and certificates, and encoding email attachments in MIME format.
A very common misconception is that Base64 provides security or privacy. It does not. Base64 is encoding, not encryption — anyone can decode a Base64 string without any key or password. It simply changes the representation of data, not its secrecy. Seeing SGVsbG8gV29ybGQ= in a URL or header is no more secure than seeing "Hello World" in plain text.
For actual security, use proper encryption algorithms like AES-256. Base64 is often used alongside encryption — for example, encrypting data with AES then Base64-encoding the resulting binary ciphertext so it can be safely stored in a text field or transmitted in a JSON response.
+ and / which have special meanings in URLs. URL-safe Base64 replaces + with - and / with _, making the output safe to include in URLs and filenames without additional encoding.=) are added to make the output a multiple of 4 characters. One = means 1 byte of padding was added; == means 2 bytes.data:image/png;base64,...