Base64 Encode / Decode

Encode text or Hex bytes to Base64, or decode Base64 to text or Hex online. Supports UTF-8, binary data, URL-safe Base64, missing padding and auto convert.

The file is read in your browser only and never uploaded.

What is Base64?

Base64 turns any data (text, images, binary files) into a string made only of letters, digits and +, / and =, so it can travel safely through places that only accept text. Common uses include email attachments, data: images in web pages, HTTP Basic authentication headers and JWTs. The encoded result is about 4/3 the size of the original.

How to use

  1. Click "Encode" or "Decode" to choose the direction; the selected button stays highlighted.
  2. Type in the Input box. With "Auto convert" on, the result appears as soon as you stop typing.
  3. "Use result as input" moves the result to the left and flips the direction, which makes it easy to check a round trip.

Plain data format: text or Hex

Standard vs URL-safe Base64

Standard Base64URL-safe Base64
Characters 62 and 63+ and /- and _
PaddingPadded with = to a multiple of 4Usually no =
Typical useEmail, data URLs, general data exchangeURL parameters, file names, JWTs

Decoding accepts both variants and works even when = padding is missing, so you never need to switch modes to decode.

Examples

Files and Base64

FAQ

Is Base64 encryption?

No. Base64 is only a different representation, and anyone can decode it. Do not use it to protect passwords or secrets. Use real encryption to keep data private, or an HMAC to check that data has not been tampered with.

Decoding says the data is "binary, not UTF-8 text"

The decoded bytes are not text; they may be an image, an archive or encrypted data. Switch "Plain data format" to Hex to see the raw bytes.

Why does the result end with one or two =?

Base64 encodes every 3 bytes as 4 characters. When the input length is not a multiple of 3, = pads the result to a multiple of 4.