Skip to content
Mediawand

Base64 Encode and Decode

Convert text to Base64 for an API, an email header or a data URL, or decode a Base64 string to see what it holds. Accented letters and emoji work, and binary data such as an image decodes to a file you can download.

How to encode or decode Base64

  1. 1Choose Encode or Decode.
  2. 2Paste your text or Base64 string.
  3. 3Copy the result, or download the file if it decoded to binary data.

UTF-8 throughout

Text is encoded as UTF-8 before converting, which is what web APIs expect, so “héllo 👋” round-trips correctly. Older tools that use plain btoa() fail on such characters.

URL-safe Base64

URL-safe Base64 (Base64URL) uses - and _ instead of + and / and drops the = padding, so it can go in URLs and file names. It's the variant used in JSON Web Tokens. Decoding accepts both variants automatically.

Images and files

If decoded data isn't text, you get a download instead, with the file type detected for PNG, JPEG, GIF, WebP, PDF and ZIP. A “data:” prefix at the start of the string is removed automatically.

Frequently asked questions

Is Base64 encryption?
No. Base64 is an encoding anyone can reverse. Never use it to hide passwords or secrets.
Is my data uploaded?
No. Encoding and decoding run in your browser.
Why does Base64 make data bigger?
Every 3 bytes become 4 characters, so Base64 is about a third larger than the original.

Related tools

Loading tools…