Skip to content
Expensico

Base64 Encoder / Decoder

Encode and decode Base64 and Base64URL for text (full UTF-8) and files, including data URLs and image previews. Runs locally.

Runs in your browser. Your files are processed on your device and are never uploaded.

How to use the Base64 Encoder / Decoder

  1. Choose Text or File.
  2. For text, pick Encode or Decode and type or paste your input.
  3. For files, choose a file to get its Base64 or a data URL.
  4. Copy or download the result.

What is Base64?

Base64 represents binary data using 64 printable characters (A–Z, a–z, 0–9, + and /). It lets images, files and binary tokens travel through systems that only handle text — JSON, email, URLs, environment variables. It is an encoding, not encryption: anyone can decode it.

Base64 vs Base64URL

Standard Base64 uses +, / and = padding, which have special meanings in URLs. Base64URL replaces them with - and _ and usually drops the padding. JWTs use Base64URL. The decoder here accepts both.

Unicode text

Text is converted to UTF-8 bytes before encoding, so Indian scripts, emoji and symbols like ₹ round-trip correctly — unlike the browser's raw btoa(), which fails on them.

Encoding files and decoding to files

Switch to File → Base64 to turn any file up to 20 MB into Base64. Tick Include data URL prefix to get a ready-to-use value such as data:image/png;base64,… for an <img> tag or a CSS background.

When you decode Base64 that turns out to be binary — an image, a PDF or a ZIP rather than text — the tool recognises the file type from its contents and offers it as a download instead of showing unreadable characters. That's handy for attachments pasted from an API response or an email's source.

Where you'll meet Base64

  • HTTP Basic authentication headers (Authorization: Basic …), which are just Base64 of username:password.
  • Kubernetes secrets and other configuration that stores binary values as text.
  • The header and payload of a JWT — use the JWT decoder to read those directly.
  • Email attachments, which travel as Base64 inside the message source.

Example

hello encodes to aGVsbG8=. Every 3 bytes become 4 characters, so Base64 is about 33% larger than the original.

Frequently asked questions

Should I embed images as Base64?

Only small ones such as icons. A data URL is a third larger than the file and can't be cached separately by the browser.

Is my file uploaded?

No. Encoding and decoding run in your browser.

Why does decoding fail?

The input contains characters that aren't part of Base64, or it was cut off. Check for missing characters at the end and stray spaces or quotes copied with it.

Is Base64 safe for passwords?

No. Base64 hides nothing — anyone can decode it in a second. Use proper encryption or a secrets manager for anything sensitive.