Base64 is an encoding scheme that converts binary data into ASCII text. It is used when you need to transmit binary data — like images or files — over systems that only handle text, such as email, JSON APIs, or HTML data URIs.
When is Base64 used?
- Embedding images directly in HTML/CSS (
data:image/png;base64,...) - Encoding binary data in JSON API responses
- Email attachments (MIME encoding)
- Storing binary data in databases that only support text columns
- HTTP Basic Authentication headers (
Authorization: Basic dXNlcjpwYXNz) - Passing file contents as URL parameters
Base64 is NOT encryption
Base64 is purely an encoding format — anyone can decode it instantly. Never use Base64 to "protect" or "hide" sensitive data. If you need to secure data, use proper encryption (AES, RSA) — not encoding.
The string SGVsbG8gV29ybGQ= looks protected, but it simply decodes to Hello World.
How to encode text to Base64
- Go to Base64 Encoder
- Type or paste your text in the input field
- Select Encode mode
- Copy the Base64 output
How to encode a file to Base64
- Click the file upload zone or drag a file in
- Select any file (image, PDF, document, etc.)
- The Base64 string appears instantly — no upload to server
- Copy and use in your code or configuration
How to decode Base64
- Switch to Decode mode
- Paste the Base64 string
- The decoded text appears instantly
For binary files (images, PDFs), the tool will offer a download link for the decoded file.
Common Base64 examples
SGVsbG8gV29ybGQ=→Hello WorlddXNlcjpwYXNzd29yZA==→user:passwordeyJhbGciOiJIUzI1NiJ9→{"alg":"HS256"}(JWT header)
Standard vs URL-safe Base64
Standard Base64 uses + and / characters, which are not safe in URLs. URL-safe Base64 replaces these with - and _. Use the URL-safe option when embedding Base64 in query parameters.