Loading tool...

How to Convert Text to Base64 - Step by Step Guide

Paste the text, wait a second, copy the Base64. Here is what happens along the way and what to watch out for.

Step 1

Enter Your Plain Text

Type or paste the text you want to encode: a note, a few lines from a config file, a message with accents or emoji. Line breaks, tabs and quotes are kept exactly as they are. If you are new to it, Base64 is a way of writing any bytes using only letters, digits, + and /.

Example: Plain Text Input

Copy this sample text to test:

Hello World! This is a text to Base64 encoding example.
•
Type or paste: Enter any text you want to encode to Base64 format
•
Unicode support: Full support for international characters, emojis (🚀 ✨), and special symbols
•
Try sample: Click the Sample button to load a short line of text
•
Long text is fine: A few thousand lines encode in a moment; tens of megabytes will make the editor slow, since everything runs in your tab
Step 2

Automatic Real-Time Encoding

About a second after you stop typing, the text is converted to UTF-8 bytes and those bytes are written out as standard Base64 (RFC 4648), with = padding at the end. That is the same result you get from the base64 command on Linux or macOS, so the encoded text decodes cleanly in any language that reads UTF-8.

Base64 Encoded Output

Your text becomes this Base64 encoded format:

SGVsbG8gV29ybGQhIFRoaXMgaXMgYSB0ZXh0IHRvIEJhc2U2NCBlbmNvZGluZyBleGFtcGxlLg==
•
Short pause: The output refreshes about a second after you stop typing
•
RFC 4648 compliant: Standard Base64 encoding following official specifications
•
Accents and emoji: "Grüße aus München" comes out as R3LDvMOfZSBhdXMgTcO8bmNoZW4=
•
Expect it to grow: The Base64 is roughly a third longer than the UTF-8 size of your text
Step 3

Copy or Download Encoded Result

Copy the result to your clipboard or save it as a .txt file. Both always use the text that is in the box when you click, even if the preview has not refreshed yet.

•
Copy to clipboard: One-click copying for quick use in your code
•
Download output: Save as text file for documentation or sharing
•
Where it goes: A one-line value in a .env or YAML file, a Kubernetes Secret, a data: link or an HTTP Basic auth header
•
Privacy protected: All encoding happens in your browser - no server upload

What is Text to Base64 Encoding?

Text to Base64 encoding is the process of converting plain text into Base64 format using 64 ASCII characters (A-Z, a-z, 0-9, +, /). This encoding makes text safe for transmission through systems that only handle ASCII, such as email protocols, HTTP headers, and JSON APIs.

When you encode text to Base64, the original characters are first converted to UTF-8 bytes, then those bytes are converted to Base64 representation. This ensures that international characters, emojis, and special symbols are properly preserved during transmission and storage in REST APIs and web applications.

Base64 is not encryption. Anyone who has the encoded text can turn it back into the original in a second, so it is a way to move text safely, not to hide it.

Understanding Base64 Encoding Algorithm

Base64 encoding converts groups of three bytes (24 bits) into four Base64 characters. The encoding algorithm splits the 24 bits into four 6-bit groups, then maps each 6-bit value to one of the 64 Base64 characters.

When the input length isn't a multiple of 3, the algorithm adds padding characters (=) to make the output length a multiple of 4. This ensures the encoded data can be properly decoded. The transformation process is defined in the MIME Content-Transfer-Encoding specification and results in an output that's approximately 33% larger than the original data.

Frequently Asked Questions

What happens to my text when I paste it in?

Nothing gets sent anywhere. About a second after you stop typing, the page turns your text into UTF-8 bytes and writes those bytes out as standard Base64 on the right. Copy and Download always take whatever is in the box at that moment, even if you clicked before the preview caught up.

When would I need plain text in Base64?

Mostly when a text has to travel through a place that is picky about characters: a value in a YAML or .env file that must stay on one line, a Kubernetes Secret, an HTTP Basic auth header, a data: link, or an email body that a gateway might mangle. Base64 keeps line breaks, quotes and tabs intact because they become ordinary letters.

My notes have umlauts and emoji. Will they come back the same?

Yes. "Grüße aus München" becomes R3LDvMOfZSBhdXMgTcO8bmNoZW4= here, which is the UTF-8 encoding you also get from the base64 command on Linux or macOS. Some older encoders treat each letter as a single byte and give R3L832UgYXVzIE38bmNoZW4= instead, which turns into garbled characters when someone decodes it as UTF-8.

Can I upload a .txt file or a whole document?

There is no upload button on this page. Open the file, select the text and paste it in. Line endings are kept as they are in the editor, so a pasted Windows file and the same file pasted on a Mac can give slightly different Base64.

Does Base64 keep my text private?

No, and it is worth being clear about that. Base64 only changes how the text is written; anyone can turn it back with a decoder in a second. Use it to move text safely, not to hide passwords or personal notes.

How big can the text be?

There is no fixed cap, but the work happens in your browser tab, so pasting tens of megabytes will make the editor sluggish. Expect the result to be roughly a third larger than the text, a bit more if it has lots of non-English characters, since those take two to four bytes each in UTF-8.

How do I turn the Base64 back into text?

Use the Base64 to Text converter, or the Reverse button above the output, and paste the encoded string there. As long as the other side reads it as UTF-8, you get your original text back character for character.

Need to go the other way? The Base64 to Text converter decodes it back to readable text.