Base64 Encode and Decode

Convert text and files to and from Base64 instantly, with URL-safe, MIME and data URI options.

  • Processed on your device
  • Instant, no queue
  • Free, no sign-up
Advertisement
Text to encode
Base64

Advertisement

How to use Base64 Encode / Decode

  1. Choose Encode or Decode, and Text or File.
  2. Type or paste into the input box. With Live on, the result updates as you type. For files, drop the file onto the box.
  3. Adjust options such as URL-safe or 76-character lines, then copy or download the result.

About this tool

Base64 represents binary data using only 64 plain-text characters (A-Z, a-z, 0-9, + and /). It is used to put images inside HTML and CSS as data URIs, to send attachments in email (MIME), to store binary data in JSON, and in HTTP Basic authentication headers and JWT tokens.

URL-safe Base64 replaces + and / with - and _ and drops the = padding, so the result can be used in URLs and file names. JWT tokens use this variant, and the decoder accepts both automatically. Split into 76-character lines produces the MIME format used in email.

When decoding, the tool detects whether the result is text, an image or another binary file. Images are previewed, and any binary output can be downloaded with the right file extension. Encoding is not encryption: anyone can decode Base64, so never use it to hide passwords.

Questions and answers

Is Base64 encryption?

No. Base64 is an encoding, not encryption. Anyone can decode it instantly, so it provides no security on its own.

Why is the Base64 output bigger than the input?

Base64 uses 4 characters for every 3 bytes, so output is about 33% larger than the original data.

How do I decode a JWT token?

Paste just the middle part (between the two dots) into Decode mode. The decoder accepts URL-safe characters and missing padding.

What is a data URI?

It is a Base64 string with a prefix like data:image/png;base64, that lets you embed a file directly in HTML or CSS, e.g. <img src="data:...">.

Which character set should I use?

UTF-8 is correct for almost everything today. Choose ISO-8859-1 or UTF-16LE only if the system you are working with expects them, for example some Windows APIs use UTF-16LE.

Advertisement