Text to Base64 Encoder
Turn any text into Base64, the safe letters-and-numbers format used in web addresses, emails, configuration files and data exchanges. Accents, symbols and emoji are encoded correctly as UTF-8, and you can choose URL-safe output or wrapped lines.
How to Encode Text to Base64
Quick answer: type or paste your text; the Base64 version appears below straight away, ready to copy.
-
1
Add your text
Type, paste or open a file.
-
2
Pick the format
Standard, URL-safe or wrapped lines.
-
3
Check the result
It updates as you type.
-
4
Copy or download
Use the Base64 anywhere.
What You Get
What Is Base64?
Base64 is a way of writing any data using only 64 safe characters: the letters A to Z and a to z, the digits 0 to 9, and + and /. Systems that were designed for plain text, such as email, web addresses, JSON, XML and configuration files, can carry Base64 without breaking. Every 3 bytes of input become 4 Base64 characters, so the result is about one third longer than the original. An = sign or two at the end pads the final group.
Accents, Symbols and Emoji
Many simple Base64 tools fail on anything beyond plain English letters, or produce results other systems cannot read. This encoder first turns your text into UTF-8 bytes, the standard used across the web, and then encodes those bytes. "Café ☕" therefore encodes correctly and decodes back to exactly the same text in any language or program that reads UTF-8.
URL-Safe and Wrapped Output
Standard Base64 uses + and /, which have special meanings in web addresses. URL-safe output replaces them with - and _ and drops the = padding, so the result can sit in a web address or file name without further encoding. This variant is used in tokens and many web services. Wrap lines at 76 characters splits long output into lines, the format used by email attachments and some certificate files.
Common Uses
Developers use Base64 to embed small data in JSON and XML, to send text through web services that only accept letters and numbers, to build authentication headers, and to store settings in environment variables. Testers use it to prepare sample data. It is also a quick way to keep a short piece of text from being read at a glance, but remember it is not encryption: anyone can decode it with Base64 to Text.
Example
"Hello, world!" becomes SGVsbG8sIHdvcmxkIQ==. With the URL-safe option, the same text gives SGVsbG8sIHdvcmxkIQ with no padding. To encode whole files such as PDFs instead of text, use PDF to Base64.
Good to Know
Base64 is case-sensitive: changing a single capital letter changes the decoded result, so always copy the whole output exactly. Line breaks in your input are encoded as well, which means "hello" and "hello" followed by a new line give different results. If a system rejects your Base64, check whether it expects the URL-safe alphabet, padding or no padding, and whether line breaks are allowed. The summary on the left shows the character counts, so you can see the one-third size increase for yourself.
Step by Step
Paste the text exactly as it must be encoded, including any line breaks it needs. Decide where the Base64 will go: for a JSON field, a header or a configuration value, keep the standard output on one line; for a web address or file name, tick URL-safe; for email bodies and certificate-style files, tick line wrapping. Copy the result with one click, or download it as a .txt file to attach or store.
Private, Free and Instant
The encoder is free and handles text up to 5 MB. There is no sign-up, no limit and nothing to install. Everything runs inside your browser, so passwords, tokens, customer data and private messages are never uploaded, logged or stored anywhere. The result updates instantly as you type or paste, and you can open a text file from your device and download the result as a new file. It works on Windows, Mac, Linux, Chromebooks, iPhone and Android.
Encoding Text as Base64
Base64 turns bytes into 64 printable characters. Text is encoded as UTF-8 first, so accented letters take more space.
Uses
- Embedding small data in URLs and JSON.
- HTTP basic authentication headers, which are encoded, not protected.
- Email attachments.
The output is about a third larger than the input. To decode, use Base64 to text.
Frequently Asked Questions
Questions about Base64 encoding