Base64 encoder and decoder

Encode and decode Base64 and Base64URL with full Unicode support, or turn a file into a data URI. Everything runs in your browser; nothing is uploaded.

Base64
The result appears here.

How to use it

Choose a direction and paste your text. Encoding uses UTF-8, so Hindi, Tamil, emoji and other non-English text round-trips correctly — plain btoa() in the browser fails on these.

Decoding accepts both standard Base64 and the URL-safe variant used in JWTs and URLs (with - and _, padding optional).

Base64 in code

  • Node.js: Buffer.from(text).toString('base64') and Buffer.from(b64, 'base64').toString()
  • Python: base64.b64encode(text.encode()).decode()
  • Shell: echo -n 'text' | base64

Questions

Is Base64 encryption?

No. Base64 only changes how bytes are written so they survive text-only channels. Anyone can decode it, so never use it to hide passwords or keys.

Why is the Base64 longer than my text?

Base64 uses 4 characters for every 3 bytes, so output is about 33% larger, plus up to two = padding characters.

What is Base64URL?

A variant that replaces + with - and / with _, and usually drops the = padding, so the result is safe inside URLs and file names. JWTs use it.

Should I inline images as data URIs?

Only small ones, such as icons under a few kilobytes. Large data URIs make HTML and CSS heavier and cannot be cached separately.

More tools