Text to Base64 Online with Real Examples
Base64 encoding converts any text or binary data into a string made up of only 64 safe ASCII characters: uppercase and lowercase letters, digits 0–9, the plus sign (+), and the forward slash (/). The result looks like gibberish but can travel safely through any system that handles text, including email servers, JSON APIs, and HTML attributes. The Text to Base64 tool handles this conversion instantly — paste your text and copy the encoded output.
What Base64 Output Looks Like
Encoding "Hello World" in Base64 produces: SGVsbG8gV29ybGQ=
The encoding works by grouping input bytes in sets of three, then mapping each group to four Base64 characters. Because the output always represents the same underlying bytes, the process is deterministic — the same input always produces the same output, which makes it suitable for verification and comparison.
The equals sign at the end (=) is padding. Base64 requires output to be a multiple of four characters. If the input byte count is not divisible by three, padding characters are added to complete the final group. One padding character means the input had two remaining bytes; two padding characters means one remaining byte.
Step-by-Step Encoding Example
Here is how "Hi" is encoded to Base64:
- H = ASCII 72 = binary 01001000; i = ASCII 105 = binary 01101001. Only two bytes, so one byte of padding (00000000) is added.
- Three-byte group: 010010000110100100000000
- Split into four 6-bit groups: 010010 | 000110 | 100100 | 000000
- Map each 6-bit value (18, 6, 36, 0) to Base64 characters: S, G, k, A
- Because padding was needed, the last character becomes = instead of A
- Result: SGk=
Verify this by pasting SGk= into Base64 to Text — the output should be "Hi".
Common Uses for Base64 Encoding
Email MIME Attachments
Email was designed for ASCII text. To send binary files (images, PDFs, documents) over email, MIME encoding Base64-encodes the attachment and includes the resulting text inside the email body. Email clients decode it automatically when displaying the attachment to the recipient.
Data URIs in HTML and CSS
A data URI embeds file content directly in an HTML attribute or CSS property: src="data:image/png;base64,iVBORw0KGgo...". The Base64 section is the image file encoded as text so it can be included inline without a separate HTTP request. Useful for small icons and images in email templates where external image loading may be blocked.
API Authentication Headers
HTTP Basic Authentication encodes credentials as Base64 in the Authorization header. A username "user" and password "pass" become Basic dXNlcjpwYXNz. APIs that use Basic Auth expect this exact format.
JWT Token Payloads
JSON Web Tokens encode their header and payload sections as Base64 (specifically URL-safe Base64 without padding). When building or testing JWT-based authentication, encoding and decoding the payload helps verify that the correct claims are present.
Base64 Is Not Encryption
A common misconception: Base64 encoding is reversible and provides no security. Anyone who receives a Base64 string can decode it immediately without a key. Using Base64 to Text to decode any Base64 string takes seconds. Never rely on Base64 to protect sensitive data — use proper encryption for that. Base64 is a transport format, not a security mechanism.
Use these tools
Keep exploring the encoding and decoding tools
This post belongs to the encoding cluster. Jump straight into the main tool, then browse related tools and the full hub.
Primary tool
Text to Base64
Encode text into Base64 safely. This Text to Base64 converter transforms plain text into Base64-encoded strings using UTF-8 encoding for secure data transmission.
Base64 to Text
Decode Base64 strings back to readable text safely. This Base64 to Text decoder converts Base64-encoded strings back to readable text using standard Base64 decoding.
Numbers to Letters Converter
Use this numbers to letters calculator to decode 1-26 into A-Z instantly. This A1Z26 decoder converts sequences like 20 5 24 20 into TEXT for ciphers, puzzles, games, and classroom activities.

