input.txt
output.txt
Encode text to Base64, or decode Base64 back to text.

Related

Guides for Base64

All guides →

Base64 Encode & Decode

Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters. It is widely used to embed binary data in text-based formats such as JSON, XML, HTML, and email.

This is a base64 converter in both directions — encode arbitrary text or decode any Base64 string back to its original form. Use it to convert to base64 online when embedding images in CSS, building data URIs, or producing Basic Auth headers. The equivalent in Python is base64.b64decode(text).decode('utf-8') (searched as base64 decode python); this page does the same thing without opening a REPL. Runs entirely in the browser, with no upload.

  • API authentication — HTTP Basic Auth credentials are Base64-encoded
  • Data URIs — images and fonts embedded in CSS or HTML as data:image/png;base64,…
  • JWT tokens — the header and payload sections of a JSON Web Token are Base64url-encoded
  • Email attachments — MIME encoding uses Base64 for binary attachments

This tool uses UTF-8 encoding, so it correctly handles non-ASCII characters such as Chinese, Arabic, and emoji — it doubles as a utf-8 decoder for Base64-wrapped text that other tools mangle.

FAQ

What's the difference between Base64 and Base64url?

Standard Base64 uses + and / with = padding; URL-safe Base64url replaces them with - and _ and drops padding so the value is safe inside URLs and JWTs.