Text to Base64 Encoder
Encode text to Base64 as you type, including accented characters and emoji.
Your files are processed on your device and are never uploaded.
Encode text to Base64 as you type. The result updates with every key you press, and it handles any language – accents, Hindi, Chinese, Arabic and emoji – because the text is converted to UTF-8 before it is encoded.
Three options cover the usual needs: URL-safe output for links and tokens, wrapping at 76 characters for email, and a data:text/plain prefix when you need a data URI.
How to Encode Text to Base64
- Type or paste your text into the Text box.
- Pick options if you need them: URL-safe, wrap at 76 characters, or add the data:text/plain prefix.
- Copy the result from the Base64 box, or click Download .txt to save it.
The Options Explained
- URL-safe (base64url): Replaces
+with-and/with_and drops the=padding. Use it in URLs, file names, cookies and JSON Web Tokens, where the standard characters cause problems. - Wrap at 76 characters: Splits the output into lines, as the MIME standard for email requires.
- Add data:text/plain prefix: Turns the string into a data URI such as
data:text/plain;charset=utf-8;base64,…that a browser can open as a text file.
Why Emoji and Accents Work Here
The JavaScript function btoa() that many simple encoders use only accepts Latin-1 characters and fails on text like "café" or "नमस्ते" or 😀. This tool first turns the text into UTF-8 bytes, then encodes those bytes. Any standard decoder – in PHP, Python, Java or the command line – gets back exactly your original text.
Common Uses
- HTTP Basic Auth headers (
username:passwordencoded to Base64) - Putting text with line breaks or quotes safely into JSON, XML or YAML
- Kubernetes secrets and environment variables
- Test data for APIs and decoders
Base64 Is Not Encryption
Base64 only changes how text looks – anyone can decode it in a second. Never use it to hide passwords or private data. Your text, however, stays private here: it is encoded in your browser and never sent anywhere.
To read a Base64 string, use Base64 to Text.
Base64 to Text Encode / Decode File to Base64 Validator & Repair
Frequently Asked Questions
How do I encode text to Base64?
Does it work with emoji and other languages?
What is URL-safe Base64?
- and _ instead of + and / and leaves out the = padding, so the string can go into URLs, file names and JWTs without escaping.Why does Base64 end with = or ==?
= signs fill the last group.