Base64 Encoder & Decoder

// encode text or files to base64 · decode base64 strings · url-safe mode · nothing leaves your browser

URL-safe
waiting for input
plain text
base64

What is Base64 encoding?

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 /.

How to use this tool

  • Select Encode tab to convert text → Base64
  • Select Decode tab to convert Base64 → text
  • Select File tab to encode any file to Base64
  • Enable URL-safe mode to replace + with - and / with _
  • Use ⇄ Swap to flip input and output instantly

Understanding Base64 encoding

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.

Base64 encoding vs encryption

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.

Frequently Asked Questions

Is Base64 a form of encryption?+
No. Base64 is encoding, not encryption. Anyone can decode a Base64 string without a key. It's meant for safe data transport, not security. Never use Base64 to hide sensitive data.
What is URL-safe Base64?+
Standard Base64 uses + 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.
Why does Base64 output end with == or =?+
Base64 encodes data in 3-byte chunks. If the input isn't divisible by 3, padding characters (=) are added to make the output a multiple of 4 characters. One = means 1 byte of padding was added; == means 2 bytes.
How much larger is Base64 output compared to the input?+
Base64 output is approximately 33% larger than the input. Every 3 bytes of input produce 4 bytes of Base64 output. This overhead is the trade-off for making binary data text-safe.
Can I encode images or binary files?+
Yes — use the File tab. Select any file (image, PDF, binary) and this tool encodes it to Base64 entirely in your browser. The output can be used as a data URI: data:image/png;base64,...