usefmtly

Base64 Encoder / Decoder

Base64 Encode / Decode — Free online Base64 encoder and decoder. Encode any text or Unicode string to Base64, or decode Base64 back to readable text. Supports standard and URL-safe variants.

0Input bytes
0Output length
EncodeMode
StdVariant
Plain text
Base64

How to encode and decode Base64

  1. Choose Encode or Decode in the toolbar. Encode converts plain text to Base64; Decode converts Base64 back to readable text.
  2. Paste your input. The result appears instantly — no button press required.
  3. Choose Standard or URL-safe depending on your use case. URL-safe replaces + with - and / with _, and removes trailing padding — safe to use in URLs without percent-encoding.
  4. Use Swap to immediately decode what you just encoded, or re-encode decoded output.

Where Base64 is used

Email attachments (MIME)

Email protocols are text-only. Attachments and images are Base64-encoded before being embedded in message bodies.

Data URIs in HTML/CSS

Small images, fonts, or icons can be embedded directly in HTML or CSS as Base64 data URIs to avoid extra HTTP requests.

JSON APIs

APIs that need to pass binary data (images, files, cryptographic keys) through JSON fields use Base64 since JSON is text-only.

JWT tokens

JSON Web Tokens use URL-safe Base64 to encode the header, payload, and signature into a compact, URL-transmittable string.

Basic HTTP authentication

The HTTP Authorization header encodes credentials as Base64: username:password → dXNlcm5hbWU6cGFzc3dvcmQ=

Environment variables and secrets

Binary keys, certificates, and config blobs are often Base64-encoded for safe storage in environment variables or CI/CD secrets.

Standard vs URL-safe Base64

PropertyStandard (RFC 4648 §4)URL-safe (RFC 4648 §5)
Characters 62–63+ and /- and _
Padding= (always)Stripped
URL-safeNo (must percent-encode)Yes
Use caseEmail, files, generalURLs, JWT, filenames

Related tools: URL Encode / Decode for percent-encoding URLs, ROT13 Encoder for simple cipher encoding, or Morse Code Translator for a completely different encoding format.

Learn more about Base64

Want a deeper explanation of how base64 works — the 6-bit groups, the = padding, and why it's not encryption? What Is Base64 Encoding? walks through the algorithm step by step with examples.

Frequently Asked Questions

What is Base64?

Base64 is an encoding scheme that converts binary data into a sequence of ASCII characters using 64 printable characters (A–Z, a–z, 0–9, +, /). It is used to safely transmit binary data over text-based systems like email (MIME), JSON APIs, and HTML data URIs.

How do I decode Base64?

Switch to "Decode" mode, paste your Base64 string, and the decoded text appears instantly. Both standard Base64 (with + and /) and URL-safe Base64 (with - and _) are accepted automatically.

What is URL-safe Base64?

URL-safe Base64 (RFC 4648 §5) replaces + with - and / with _ so the encoded string can be used directly in URLs and filenames without percent-encoding. Padding (=) is also removed. Use it when embedding Base64 in query strings or JWT tokens.

Does Base64 work with Unicode and emoji?

Yes. Text is first converted to UTF-8 bytes before encoding, so any Unicode character — accented letters, CJK characters, emoji — round-trips correctly.

Is Base64 encryption?

No. Base64 is encoding, not encryption. It is trivially reversible by anyone — there is no key or secret. Never use Base64 to hide sensitive data. Use it only when you need to represent binary data as plain text.

Related Tools