handy.moe

All tools / Debug tools

A digital stamp on a phone

Base64 encode and decode

Turn text or a file into Base64, or Base64 back into text or a picture. Handles UTF-8, URL-safe Base64 and missing padding.

Runs in your browser. Pasted data never leaves it.

How to use it

  1. Type or paste text into the top box.
  2. Press Encode to get Base64, or Decode to turn Base64 back into text. With “Live” on, it updates as you type.
  3. Switch on URL-safe if the result goes into a URL or a JWT.
  4. Copy or download the result.

Questions

What is Base64 for?

Base64 turns bytes into 64 safe text characters so binary data (images, keys, files) can travel through text-only places such as JSON, email, URLs and HTML. It is encoding, not encryption: anyone can reverse it.

What is URL-safe Base64?

The standard alphabet uses + and /, which have special meanings in URLs. The URL-safe form uses - and _ instead and often drops the = padding. JWTs use this form.

Why does decoding give strange characters?

The decoded bytes may not be text (a PNG, a gzip, a key), or they may be text in another encoding. This page reads the bytes as UTF-8, and tells you when they are not valid UTF-8.

Can I encode a file or an image?

Yes. Use “Encode a file to Base64” (read in your browser, never uploaded). To turn Base64 back into a picture, paste it (a data:image/…;base64, prefix is optional) and press “Show as image”.

Does it handle accents, emoji and non-English text?

Yes. Text is converted to UTF-8 bytes first, so é and 😀 round-trip correctly (plain btoa() in JavaScript fails on them).

Is what I paste or test sent anywhere?

No. This page works entirely inside your browser, and pasted data never leaves your device. It makes no network requests while you use it, and the page also tells your browser to block them (a Content-Security-Policy with connect-src 'none'), so even a bug could not send your data out. To check it yourself, open your browser's developer tools, go to the Network tab, and use the tool: nothing will appear. There is no account, no analytics and no logging.