Upload a file
  1. base64hub
  2. Text tools
  3. UTF-8 to Base64

UTF-8 to Base64: Encode Unicode Text and Emoji

Every character is converted to its UTF-8 bytes, which are then Base64-encoded, so emoji, accents and any script come out byte-exact and decode the same everywhere.

Free no sign-up, no limits Local nothing uploaded 1–4 bytes per character in UTF-8 Updated Oct 27, 2026
Input 0 BOutput 0 BSize –

Processed in your browser. This page cannot send your data anywhere – how we know

How to encode UTF-8 text to Base64

  1. Type or paste your text into Input · text. Charset is already set to UTF-8.
  2. The Base64 appears in Output · Base64. The Input figure under the tool is the UTF-8 byte count; the counter above the box counts characters the way JavaScript does, so an emoji counts as 2.
  3. Tick URL-safe (- _) and No padding (=) for URLs and tokens, or pick a Line wrap for email or PEM.
  4. Copy the output or download it as base64.txt.

Base64 to UTF-8 turns the result back into text.

How UTF-8 turns characters into bytes

UTF-8 uses 1 to 4 bytes per code point. ASCII stays at 1 byte, which is why English text encodes the same in UTF-8 and ASCII. Everything else takes more:

CharacterCode pointUTF-8 bytesBase64
AU+004141QQ==
éU+00E9C3 A9w6k=
€U+20ACE2 82 AC4oKs
日本語U+65E5 U+672C U+8A9E9 bytes, 3 each5pel5pys6Kqe
😀U+1F600F0 9F 98 808J+YgA==

Since Base64 adds a third on top of the bytes, a Chinese or Japanese sentence grows roughly fourfold from characters to Base64 characters, and an emoji alone becomes 8 characters. Keep that in mind for fields with a length limit; the size calculator helps.

Emoji sequences and skin tones

What looks like one emoji is often several code points glued together. A skin tone is a separate modifier, and family or profession emoji join several people with an invisible zero-width joiner (U+200D):

EmojiCode pointsUTF-8 bytesBase64
😀148J+YgA==
👍🏽2 (thumbs up + medium skin tone)88J+RjfCfj70=
👨‍👩‍👧5 (three people + two joiners)188J+RqOKAjfCfkanigI3wn5Gn

Cutting a Base64 string or its decoded bytes in the middle of such a sequence leaves broken characters, so never truncate encoded UTF-8 at an arbitrary byte.

Same text, different bytes: Unicode normalization

Some characters have two valid spellings in Unicode. é can be the single code point U+00E9 (composed, NFC) or e followed by U+0301 COMBINING ACUTE ACCENT (decomposed, NFD). Both render identically, but the bytes differ:

TextFormBytesBase64
éNFCC3 A9w6k=
éNFD65 CC 81ZcyB
naïveNFC6bmHDr3Zl
naïveNFD7bmFpzIh2ZQ==

File names on Apple’s older HFS+ file system are stored decomposed, while most keyboards produce composed text. If you compare Base64 values, sign them or use them as keys, normalize first. This tool encodes exactly the code points you paste and does not normalize.

UTF-8 to Base64 in code

In JavaScript, TextEncoder always produces UTF-8. Normalize first when the input may come from different sources:

const text = "e\u0301".normalize("NFC");
Buffer.from(text, "utf8").toString("base64");   // "w6k=" (Node.js)
new TextEncoder().encode(text);                  // Uint8Array [195, 169]

In browsers the bytes from TextEncoder can go to bytes.toBase64() where it is supported (Uint8Array.toBase64), or through the btoa helper on the JavaScript page.

import base64, unicodedata

s = unicodedata.normalize("NFC", "nai\u0308ve")
base64.b64encode(s.encode("utf-8")).decode()   # 'bmHDr3Zl'

See Base64 in Python for files and streaming.

FAQ

Is Base64 of UTF-8 the same as normal Base64?

Yes. Base64 always encodes bytes; “UTF-8 to Base64” just says which bytes. For plain ASCII text the UTF-8 bytes equal the ASCII bytes, so the output is identical either way.

Why do two identical-looking strings give different Base64?

Unicode can write some characters in more than one way. é as one code point is w6k=, while e plus a combining accent is ZcyB. Normalize to NFC before encoding if the values must match.

Does the encoder add a UTF-8 byte order mark?

No. The output starts directly with your text’s bytes. If a consumer insists on a BOM, the Base64 has to begin with 77u/, which is the encoding of the bytes EF BB BF.

How many bytes does an emoji take?

A single emoji code point takes 4 bytes in UTF-8. Emoji with skin tones or joined families are several code points: 👍🏽 is 8 bytes and the family 👨‍👩‍👧 is 18.