Base64 Encode and Decode

Paste text to get its Base64 code, or paste a Base64 code to read the text it holds. Turkish letters and emoji are encoded correctly as UTF-8.

Free Runs in your browser Checked Tuesday, November 10, 2026

The text to encode, or the Base64 code to decode. Line breaks inside a Base64 code are ignored.

Action

Uses - and _ instead of + and /, and leaves out the = padding. Decoding accepts both alphabets.

Result

Result

This tool runs in your browser. What you enter is not sent to us.

How to use it

  1. Paste your text into Text or Base64.
  2. Choose Encode text to Base64 or Decode Base64 to text in Action.
  3. Tick URL-safe alphabet if the code goes into a web address or a file name.
  4. Use the copy button on the Result box, or download it as a text file.

How Base64 works

Base64 writes bytes as text that uses only 64 characters that are safe in almost every system. Every three bytes, which are 24 bits, become four characters of six bits each. When the last group has one or two bytes, the code ends with one or two = signs, which are called padding.

The result is always about a third longer than the input, because three bytes become four characters.

Padded length = 4 × ⌈n ÷ 3⌉ characters

n  number of bytes in the input
⌈ ⌉  round up to a whole number

Text, UTF-8 and the two alphabets

Base64 works on bytes, so the text is first written in UTF-8, the encoding that web pages and most files use. A Turkish letter such as ğ takes two bytes, and an emoji takes four.

  • Standard alphabet (RFC 4648, section 4): A to Z, a to z, 0 to 9, + and /, with = padding at the end.
  • URL and filename safe alphabet (RFC 4648, section 5): - and _ instead of + and /. This mode leaves out the padding.
  • Decoding accepts both alphabets, a code without padding and line breaks.

What decoding refuses

  • Characters that are in neither alphabet, such as ! or %.
  • A length that no Base64 code can have, such as five characters after the groups of four.
  • Bytes that are not valid UTF-8. The Base64 of an image decodes to bytes that are not text, and the page says so instead of showing garbage.

Base64 is not encryption

Base64 is a way of writing bytes as text, not a secret. Anyone can decode it, so do not use it to hide a password or a key. The text is converted in this browser only and is not sent to us.

Worked example: Merhaba, dünya!

The text has 15 characters, but the letter ü takes two bytes in UTF-8, so the text is 16 bytes. The padded length is 4 × ⌈16 ÷ 3⌉ = 24 characters.

With the standard alphabet the result is TWVyaGFiYSwgZMO8bnlhIQ==. With the URL-safe alphabet ticked, the same code has no padding: TWVyaGFiYSwgZMO8bnlhIQ, 22 characters.

Standard URL-safe
Result TWVyaGFiYSwgZMO8bnlhIQ== TWVyaGFiYSwgZMO8bnlhIQ
Length 24 22

Frequently asked questions

What is Base64 used for?

It carries binary data such as images, files and tokens through systems that accept only text, such as email attachments, JSON fields and data URLs. The code is about a third longer than the original.

Is Base64 the same as encryption?

No. Base64 is a reversible way of writing bytes, and anyone can decode it without a key. Protect data with real encryption, not with Base64.

Why does my decoded text show strange letters?

Usually the bytes are not UTF-8. The text was saved in an older encoding, such as Windows-1254 for Turkish. The page refuses bytes that are not UTF-8 instead of showing them wrongly.

What is the URL-safe alphabet?

RFC 4648 section 5 replaces + with - and / with _, so the code can sit in a web address or a file name without escaping. It is written here without the = padding.

Does the tool send my text to a server?

No. Your browser does the encoding and the decoding. Nothing is sent, stored or logged, so you can paste private data.

Can I decode a Base64 image here?

The page reads Base64 as text, so an image decodes to bytes that are not text and is refused. To look at an image, put its full data URL, which starts with data:image and a type, into the address bar of your browser.

Sources

Figures and text last checked on Tuesday, November 10, 2026.

We use necessary cookies to run the site. With your consent, Google also uses advertising cookies to show personalised ads. If you reject them, you still see ads, but they are not personalised.