Base64 Encoder/Decoder

Encode and decode Base64 safely in your browser. Convert text to Base64 (and back), learn about UTF‑8, URL‑safe Base64, padding, and build data URIs for images or inline assets.

Text to Encode

Base64 Output

About Base64

Base64 is a binary-to-text encoding scheme used to represent binary data in ASCII. It is commonly used in emails, data URIs, and web APIs.

Encode or decode Base64 quickly in the browser. Paste your text, switch modes if needed, and copy the result.

What is Base64?

Base64 is a binary‑to‑text encoding that represents bytes using ASCII characters. It’s commonly used in email MIME, data URIs, and web APIs to safely transmit binary content over text‑only channels.

Common uses

  • Embedding small images/fonts as data: URIs
  • Transporting binary payloads in JSON or form fields
  • Persisting short blobs in local storage or configuration files

Best practices

  • Base64 is not encryption—do not store secrets or credentials without proper cryptography.
  • Use UTF‑8 when encoding text; normalize line endings to avoid mismatches.
  • Be mindful of size: Base64 inflates data by ~33%; prefer links over embedding large files.
  • For URLs, consider URL‑safe Base64 (replace +// with -/_ and optionally trim = padding) if your protocol expects it.

How to use this tool

  1. Enter plain text to encode or Base64 text to decode.
  2. Click the action button to convert.
  3. Copy the output for use in your app or documentation.

Example: Text → Base64

Input: hello
Output: aGVsbG8=

Create a data URI from Base64

data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAA...

Common issues and fixes

  • Garbled characters after decode → ensure original text was UTF‑8 when encoded.
  • Invalid input error → remove whitespace/line breaks and confirm correct padding =.
  • Wrong alphabet in URLs → use URL‑safe Base64 if your backend expects - and _.

FAQ

Is Base64 secure?
No. It’s reversible encoding, not encryption.

Why does the output end with =?
Padding aligns the output to a 4‑character boundary.

Can I decode images with this?
You can decode the Base64 string to bytes programmatically; this tool targets text content.

Related tools on ChangeBlogger