All tools

Base64 Encode and Decode

Encoders

Turn text, files and images into Base64 and back. UTF-8, emoji and URL-safe Base64 are handled correctly, and nothing leaves your browser.

  • Base64
  • Encoder
  • Runs offline
Base64
R3LDvMOfZSBmcm9tIEt5aXYg4oCUIOadseS6rCDwn5GL

What Base64 is

Base64 writes any bytes with 64 safe characters — A–Z, a–z, 0–9, + and / — so binary data can travel through places that only accept text: JSON, email, HTML, environment variables, Kubernetes Secrets. Every 3 bytes become 4 characters, so the result is about a third larger than the original.

Base64 is an encoding, not encryption. Anyone can decode it in one step, so it must never be used to hide a password or a key.

  • Standard+ and /, padded with =. Email, PEM keys, data: URIs.
  • URL-safe (base64url)- and _ instead, usually unpadded. JWTs, URLs, file names.
  • Padding= rounds the length up to a multiple of 4. Most decoders do not need it.
  • Text needs bytes firstText becomes UTF-8 bytes before encoding — the step btoa() skips.

How to use the Base64 encoder

  1. Pick Encode or Decode.
  2. Type or paste text — or press Open File to encode any file, up to 10 MB.
  3. Tick URL-Safe Alphabet for JWTs and URLs, Data URI to paste the result straight into HTML or CSS.
  4. When decoding, text is shown as text; images are previewed, and any other binary data is shown as hex with a Download button.
  5. Press Use as Input to run the result back the other way.

Examples

Decode a Kubernetes Secret

Secret values are Base64 — readable by anyone with access to the object.

Read a JWT payload

The middle part of a JWT is base64url without padding.

Preview an image from a data URI

Paste a data:image/png;base64,… string and see the picture.

Encode text with emoji

Accents and emoji are encoded as UTF-8 first, so nothing is lost.

Frequently asked questions

Is Base64 encryption?

No. It is an encoding anyone can reverse without a key. Use it to move bytes through text, never to protect them.

Why does btoa() fail on my text?

The browser's btoa() only accepts characters up to U+00FF, so accents beyond Latin-1, Cyrillic, CJK and emoji make it throw. Encode the text as UTF-8 bytes first — this tool does that for you.

Why is the Base64 longer than the original?

Every 3 bytes become 4 characters, so Base64 is about 33% larger, plus up to two = signs of padding.

What is the difference between Base64 and base64url?

base64url swaps + and / for - and _, which are safe in URLs and file names, and usually drops the padding. The decoder reads both.

Is my file uploaded?

No. Files are read from your disk straight into this page and encoded in your browser. Check the Network tab in your developer tools.

Related tools

Learn more