Free forever · No sign-up

Base64 Encode

Encode any text to Base64 instantly — UTF-8 safe, emoji supported. Free, fast, no sign-up.

Last updated: October 2026

Your data stays in your browser.

Recent

No recent conversions yet.

How Base64 encoding works

  1. Text is converted to its UTF-8 bytes.
  2. Bytes are split into groups of 3 (24 bits).
  3. Each group becomes 4 Base64 characters (6 bits each); '=' pads the end.

Example: "Hi" → 48 69 → SGk=.

Background reading: the Base64 encoding scheme on Wikipedia.

Base64 alphabet

The 64 characters of the Base64 alphabet and their 6-bit values (0–63).

CharValueCharValueCharValueCharValue
A0B1C2D3
E4F5G6H7
I8J9K10L11
M12N13O14P15
Q16R17S18T19
U20V21W22X23
Y24Z25a26b27
c28d29e30f31
g32h33i34j35
k36l37m38n39
o40p41q42r43
s44t45u46v47
w48x49y50z51
052153254355
456557658759
860961+62/63

Base64 encoding in code

Python

import base64
base64.b64encode("Hi 👋".encode()).decode()
# → 'SGkg8J+Riw=='

JavaScript

btoa(unescape(encodeURIComponent("Hi 👋")));
// → 'SGkg8J+Riw=='

C

/* C has no standard-library Base64. The usual approach:
   1. Take the 64-character alphabet:
      "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
   2. Split the input bytes into 6-bit groups; each group (0-63)
      is an index into the alphabet.
   3. Every 3 input bytes become 4 output characters; pad the
      final group with '='. Example: "Hi" -> 0x48 0x69
      -> 6-bit groups 18, 6, 36 -> "SGk=". */

Common values

  • “Hi” → SGk=
  • “Man” → TWFu
  • “A” → QQ==
  • “AB” → QUI=
  • empty string → empty string

Key takeaways

  • Base64 packs 3 bytes into 4 ASCII characters — output grows about 33%.
  • The alphabet is A–Z, a–z, 0–9, +, / with = padding.
  • It is an encoding, not encryption — anyone can decode it.
  • Use the URL-safe variant (– and _) inside URLs.

Frequently asked questions

What is Base64?

Base64 turns binary data into plain ASCII text using 64 safe characters — handy for embedding data in JSON, URLs and emails.

Does it support emoji?

Yes — the encoder is UTF-8 safe, so emoji and non-Latin scripts encode correctly.

Is Base64 encryption?

No — anyone can decode it. It encodes data for transport, it doesn't protect it.

Why does Base64 output end with =?

= is padding — it fills the last 4-character group when the input is not a multiple of 3 bytes.

How much bigger is Base64 than the original?

About 33% bigger — every 3 bytes become 4 characters.

What characters are used in Base64?

A–Z, a–z, 0–9, + and / (64 total), plus = for padding. See the alphabet table above.

Is Base64 safe for URLs?

Standard Base64 is not — + and / have special meaning in URLs. URL-safe Base64 swaps them for – and _.

Need to decode? Try our Base64 decoder.

More converters