P
Privatool
Guide2 min read

Base64 Encode & Decode Online — What It Is and How to Use It

Encode text or files to Base64 and decode Base64 strings back to readable text. Free, instant, and works entirely in your browser.

By Privatool Team·

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

  1. Go to Base64 Encoder
  2. Type or paste your text in the input field
  3. Select Encode mode
  4. Copy the Base64 output

How to encode a file to Base64

  1. Click the file upload zone or drag a file in
  2. Select any file (image, PDF, document, etc.)
  3. The Base64 string appears instantly — no upload to server
  4. Copy and use in your code or configuration

How to decode Base64

  1. Switch to Decode mode
  2. Paste the Base64 string
  3. 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 World
  • dXNlcjpwYXNzd29yZA==user:password
  • eyJhbGciOiJIUzI1NiJ9{"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.

Encode or decode Base64 free →

#base64 encoder#base64 decoder#base64 online#encode base64#what is base64

Try our free tools

All tools run in your browser. Files never leave your device.

Explore free tools →