“encode” in Base64

The text “encode” encodes to the 8-character Base64 string below. Everything on this page is derived the same way the homepage tool derives it: the text is converted to its UTF-8 bytes, those bytes are regrouped from 8-bit chunks into 6-bit chunks, and each 6-bit value is read off the standard alphabet.

Encoding result

The UTF-8 payload is 6 bytes; the encoded output is 8 characters including padding, a growth factor of about ×1.33.

How the first bytes are encoded

Each group of three bytes becomes four output characters. Taking the first 6 bytes of this text step by step:

Bytes8-bit binary6-bit indicesAlphabet output
0x65 0x6e 0x63011001 010110 111001 10001125 → 22 → 57 → 35ZW5j
0x6f 0x64 0x65011011 110110 010001 10010127 → 54 → 17 → 37b2Rl

The indices point into the 64-character alphabet ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/, reading left to right from index 0. Remaining groups follow the same recipe, and a final group shorter than three bytes is zero-padded to the next 6-bit boundary, with one = for two missing bytes or two = for one.

Frequently asked questions

Why is the Base64 form of this text longer than the text itself?
Base64 carries every 3 bytes of input as 4 characters. This text is 6 bytes in UTF-8, so its encoded form runs 8 characters — a growth factor of about 1.33. Padding with the = sign tops the output up to a multiple of four.

Can this value be used directly in a URL?
Not unchanged when it contains + or /, because both are reserved in query strings. The URL-safe variant swaps them for - and _. For this text the two forms happen to be identical, since no + or / appears.

How do I get the original text back?
Paste the encoded string into the decoder on the homepage. It sniffs the input automatically, tolerates missing padding, and decodes through a UTF-8 bridge so multi-byte characters survive the round trip intact.

Other texts

Encoding something longer, or decoding in the other direction? The Base64Deco bridge handles multi-line input, files and image data URLs, or browse the full reference library.