Skip to content
Kural

Base64 encoder and decoder

Text and files to Base64 and back, UTF-8 and URL-safe variants.

Base64 turns arbitrary bytes into ASCII text. That is how images end up inside CSS, how email attachments are sent and how a lot of APIs pass binary data around. Text is converted through UTF-8 first, so Cyrillic, Kazakh letters and emoji come back intact. Plain btoa() throws on them.

The URL-safe switch produces base64url, the variant used in JWTs and URLs: + and / become - and _, and padding is dropped. The decoder accepts either variant.

How to use

  1. Choose Encode or Decode.
  2. Type the text or paste the Base64 string. To encode an image or another file, press Encode a file…
  3. Copy the result. For files you can copy a ready data: URI to use in HTML or CSS.

Examples

Text
Hello, world! → SGVsbG8sIHdvcmxkIQ==
UTF-8
Салам → 0KHQsNC70LDQvA==

Frequently asked questions

Is Base64 encryption?

No, it is an encoding and anyone can reverse it. Don’t use it to hide passwords or keys.

Why is the Base64 string longer than the original?

Every 3 bytes become 4 characters, so the size grows by about 33%.

What is the difference between Base64 and base64url?

base64url replaces + with - and / with _ and usually drops the = padding, so the string can go into a URL or a file name as is.