Developer & Text Tools

Base64 Encoder/Decoder

Encode text or any file to Base64 (standard or URL-safe, optionally as a data URI), and decode Base64 back to text or to a downloadable file. UTF-8 is handled correctly.
Runs in your browserLive result

Workspace

Options

Uses - and _ instead of + and /, without padding (RFC 4648 §5).

Prefix with data:<type>;base64, for HTML and CSS.

How to use this tool

  1. 1Choose Encode or Decode.
  2. 2Type or paste text, or open a file to encode its bytes.
  3. 3Pick URL-safe output, line wrapping or a data URI if you need them.
  4. 4Copy the result, or download the decoded file.

Frequently asked questions

This tool encodes text as UTF-8 first, which is what browsers, servers and most languages expect. Tools that use the old btoa() function fail or produce different output for characters such as é, ✓ or emoji.

It replaces + and / with - and _ and drops the = padding (RFC 4648 §5), so the result can go in URLs and file names without escaping. The decoder accepts both alphabets.

Yes. If the decoded bytes are not readable text, the tool detects common file types such as PNG, JPEG, PDF and ZIP and offers the original file as a download.

No. Base64 is an encoding that anyone can reverse. Do not use it to hide passwords or secrets.

No. Everything runs in your browser with JavaScript. The text you paste is not uploaded, logged or stored by MuhammadLab.