What Is the Base64 of "Hello World"?
The Base64 encoding of "Hello World" is SGVsbG8gV29ybGQ=. Each character is converted to its ASCII byte value, then the bytes are grouped into 6-bit chunks and mapped to the Base64 alphabet (A-Z, a-z, 0-9, +, /). The trailing = is padding because "Hello World" is 11 bytes, which is not evenly divisible by 3.
How It Works Step by Step
"Hello World" in ASCII bytes is: 72 101 108 108 111 32 87 111 114 108 100. Base64 processes these 3 bytes at a time, converting each group into 4 Base64 characters. The last group has only 2 bytes, so one = pad character is appended.
Code Examples
JavaScript
btoa('Hello World');
// "SGVsbG8gV29ybGQ="
Python
import base64
base64.b64encode(b'Hello World').decode()
# 'SGVsbG8gV29ybGQ='
Bash
echo -n 'Hello World' | base64
# SGVsbG8gV29ybGQ=
Try It Yourself
Use our Base64 Encode & Decode tool to encode or decode any string instantly in your browser.
Frequently Asked Questions
How do I Base64 encode a string in JavaScript?
Use btoa('Hello World') which returns 'SGVsbG8gV29ybGQ='. For Unicode strings, use btoa(unescape(encodeURIComponent(str))).
Why does Base64 output end with an equals sign?
The = character is padding. Base64 encodes 3 bytes at a time into 4 characters. If the input length is not a multiple of 3, = signs are added to make the output a multiple of 4 characters.
Is Base64 encoding the same as encryption?
No. Base64 is a reversible encoding, not encryption. Anyone can decode a Base64 string. Use AES or RSA for actual data protection.