Base64 Encoder and Decoder

Convert text to Base64 or decode a Base64 string back to readable text. It handles UTF-8 characters such as emoji and Arabic, and can produce URL-safe Base64. Everything runs in your browser.

Encode or decode Base64

How to encode or decode Base64

  1. Paste your text, or your Base64 string, into the input box.
  2. Press Encode to Base64 or Decode from Base64.
  3. Tick the URL-safe box before encoding if you need - and _ instead of + and /.
  4. Press Copy output.

What Base64 is and is not

Base64 represents bytes using 64 printable characters so they can travel through systems built for text, such as email, JSON and URLs. For example, Hello encodes to SGVsbG8=. It makes data about one third bigger. It is not encryption: anyone can decode it, so never use it to hide passwords or secrets.

UTF-8 and special characters

Text is converted to UTF-8 bytes before encoding, so emoji, accented letters and Arabic or Chinese text all round-trip correctly. Many simple Base64 snippets break on those characters.

URL-safe Base64 and JWTs

URL-safe Base64 swaps + for - and / for _ and usually drops the trailing = padding. The three parts of a JSON Web Token (JWT) are URL-safe Base64, so you can paste the header or payload part into the decoder to read the JSON inside. This page does not verify signatures, so decoding a token says nothing about whether it is genuine.

Why decoding can fail

Spaces and line breaks are ignored, and missing = padding is added automatically. You will still get an error if the string has characters outside the Base64 alphabet. If the data decodes to something that is not UTF-8 text, such as an image or a ZIP file, the tool says so instead of showing garbled characters.

Frequently asked questions

How do I decode a Base64 string?

Paste it into the input box and press Decode from Base64. The text appears in the output box.

Is Base64 encryption?

No. It is a reversible encoding with no key. Anyone can decode it.

Why does Base64 often end with =?

The equals signs are padding that makes the length a multiple of four. URL-safe Base64 usually leaves them off.

What is URL-safe Base64?

A variant that uses - and _ instead of + and /, so the result can sit in a URL without extra encoding.

Why do I get garbled text when I decode?

The data probably is not text, for example an image or a file. This tool only shows UTF-8 text and tells you when the data is something else.

More free tools