Base64 Encoder

This Base64 encoder turns any text into Base64. It handles accented letters and emoji correctly. Many simple encoders fail on them. You can also pick a URL safe variant or wrap lines at 76 characters.

Your files never leave this device

Encode to Base64 Live · Full Unicode

Variant

How to encode text to Base64

  1. Type or paste your text into the box above.
  2. Tick URL safe if the result goes into a link or a cookie.
  3. Tick the 76 character wrap only for email or PEM files.
  4. Read the encoded text that appears right away.
  5. Copy the result or download it.

What this Base64 encoder gives you

  • Full Unicode support for accents, world scripts and emoji.
  • A URL safe variant with no padding.
  • Optional line wrap at 76 characters for MIME and PEM.
  • A live note on how much larger the encoded text is.
  • Instant updates with no button to press.
  • No upload so tokens and settings stay on your machine.

What is Base64 for?

Much of the internet carries text and nothing else. Email headers do. URLs do. JSON strings and HTTP headers do too. These systems may mangle or reject raw bytes.

Base64 maps any data onto 64 safe characters. It uses letters and digits. It adds the plus sign and the slash. Every one of those systems handles them fine.

The cost is size. Every three bytes become four characters. So encoded text runs about 33 percent larger. That is the price of safe travel through text only systems.

Where you meet Base64 every day

PlaceWhat it holds
HTTP Basic auth headerA username and password in Base64
JSON Web TokenThree parts in URL safe Base64
Data URIA small image inside CSS or HTML
Email attachmentA file split into 76 character lines
PEM certificateA key between BEGIN and END lines

Why a good Base64 encoder must handle Unicode

The browser has a built in function called btoa. It accepts only characters below 256. Give it "café" and it throws an error. Give it an emoji and it fails too. Many online encoders break on text in other languages for this reason.

This tool turns your text into UTF-8 bytes first. Then it encodes those bytes. That order is correct. It means every script works. French and Greek encode cleanly. Arabic, Bengali and Japanese do too. Any system that decodes the result must read the bytes as UTF-8. Every modern system does that by default.

When to pick the URL safe variant

Standard Base64 uses + and /. Both mean something in a URL. A plus can stand for a space in a query string. A slash splits a path.

The URL safe variant swaps them for - and _. It usually drops the = padding too. Use it for anything inside a URL path or a query value. Use it for file names and cookies as well. JSON Web Tokens use this form. That explains the underscores you see in them.

Base64 is not encryption

This point needs plain words. Base64 has no key and no secret. Anyone can decode it in one click. The Base64 decoder on this site does it instantly.

So encoding a password gives zero protection. The same goes for an API key or personal data. It hides nothing from anyone who looks. Data that needs protection needs real encryption.

Common Base64 encoder problems

Another tool shows a different result

That tool may use a different text encoding. This tool uses UTF-8, the modern standard.

My link breaks with the encoded value

You used standard Base64 in a URL. Switch on the URL safe option.

The output has line breaks I do not want

Turn off the 76 character wrap. Keep it only for email and PEM files.

A quick Base64 encoder example

Type the word Hello into the box. The tool shows SGVsbG8=. The equals sign at the end is padding. It fills the last group up to four characters. Turn on the URL safe option and the padding goes away.

Tips for using Base64 well

  • Keep Base64 for small data such as icons and tokens.
  • Link large images as files and not as data URIs.
  • Never treat Base64 as a way to hide secrets.
  • Match the variant to the system that reads it.

Who uses a Base64 encoder?

Developers build auth headers and test APIs. Web designers embed small icons. Email teams check attachments. Students learn how encoding works.

Your text stays private

The tool runs in your browser. The text you paste never leaves your device. Want to encode an image file? Use the image to Base64 converter. Need to escape a link instead? The URL encoder handles that.

Frequently asked questions

Is Base64 a form of encryption?

No. It has no key. Anyone can decode it in a second. It gives no protection for passwords or personal data.

Does the Base64 encoder handle emoji and accents?

Yes. The tool turns text into UTF-8 bytes before it encodes them. The plain browser function fails on those characters.

When should I use the URL safe variant?

Use it whenever the result goes into a URL, a file name or a cookie. Standard Base64 uses plus and slash and both mean something in URLs.

Why is the encoded text larger?

Base64 writes three bytes as four characters. So the output is about a third larger.

What is the 76 character wrap for?

Email standards limit lines to 76 characters. PEM certificates follow the same rule. Leave it off for URLs and JSON.

Does the tool upload my text?

No. Your browser does all the work. Your text stays on your device.