Base64 Encoder - Encode Text Online
Encode any text string or file to Base64 format. Useful for embedding data in HTML, CSS, APIs, and data URIs.
How to encode text as Base64
Enter UTF-8 text to represent it with the Base64 alphabet. The result is useful when a text-only field must carry bytes without interpreting the original punctuation. Enable URL-safe mode when the output will be placed in a URL or token segment; this substitutes URL-friendly characters and removes trailing padding.
Encoding increases the amount of text and does not protect confidentiality - Anyone can reverse it. Do not use Base64 as a password-storage or encryption method. To inspect an existing value, use the Base64 decoder.
Carry bytes as text
Create an ASCII representation for a text-only field that cannot safely carry the original byte sequence.
Expect a larger value
Base64 represents each three input bytes with four output characters, plus padding when the final group is short.
Choose the target alphabet
Use standard Base64 for MIME-style data and URL-safe Base64 when plus, slash, or trailing padding would cause trouble.
Where Base64 encoding is used
Use Base64 only when the receiving format calls for a text representation of bytes.
| Context | Expected content | Important check |
|---|---|---|
| Email attachment | MIME transfer encoding | Follow the message part headers and line-wrapping rules |
| Data URI | Inline image, font, or file | Include the correct media type and consider the larger page weight |
| JWT segment | URL-safe JSON representation | Signing is a separate step; encoding does not authenticate the claims |
| Basic authorization value | Username and password transport | Send only over HTTPS because the value is reversible |
| Text-only configuration field | A documented byte container | Confirm whether standard or URL-safe Base64 is required |
Related developer tools
Understand what changes during conversion
These maintained explanations cover the behavior, limits, and decisions that the interactive result alone cannot show.