String to Base64 Converter - Encode Text to Base64 Online
Convert plain text strings to Base64 encoded format instantly. Encode text to Base64 for data transmission and storage. Free online String to Base64 encoder.
Loading tool...
How to Convert String to Base64 - Step by Step Guide
Enter Your Text
Start by typing or pasting your plain text string into the input area that you want to encode to Base64.
Automatic Encoding
There is no button to press. About a second after you stop typing, the text is encoded to standard Base64 and shown on the right. The Sample text becomes QmFuZHdpZHRoOiA1MDBNYnBzIG9uIFRvd2VyIDVHLTAwMQ==.
Copy or Download Result
Once encoded, you can copy the Base64 string to your clipboard or download it for use in your projects.
encoded-base64.txtWhat is String to Base64 Encoding?
String to Base64 encoding converts plain text into Base64 format, enabling safe transmission through REST APIs, HTTP headers, and email systems.
The browser's own btoa() function only understands Latin-1, so this page first turns your text into UTF-8 bytes and encodes those. That is what servers, command-line tools and most programming languages expect, so Unicode text like "José 😀" decodes back correctly on the other end.
Frequently Asked Questions
How do I encode a string to Base64?
Type or paste your text on the left. About a second after you stop typing, the Base64 version shows up on the right, ready to copy or download as a .txt file. Copy and Download always use what is in the editor at that moment.
Why encode strings to Base64?
Base64 turns any text into plain ASCII letters, digits, + and /, so it can pass through systems that only expect ASCII: HTTP Basic auth headers, data: URIs, JSON or XML fields that must not contain line breaks, and environment variables or Kubernetes secrets.
How are accents, emoji and other non-English characters handled?
The text is turned into UTF-8 bytes first and those bytes are encoded, the same as base64 on Linux or Buffer.from(text).toString("base64") in Node.js. So "José 😀" becomes Sm9zw6kg8J+YgA== and decodes back to exactly the same text anywhere that reads UTF-8.
Is the output safe to put in a URL?
Not directly. This is standard Base64 (RFC 4648) with + and / and = padding. In a URL, either percent-encode it or swap + for - and / for _ and drop the padding if the receiving side expects the URL-safe variant.
Is my text sent anywhere?
No. Encoding runs in your browser with JavaScript and the page makes no request with your text. Keep in mind that Base64 is an encoding, not encryption: anyone who has the output can decode it, so it does not hide passwords or keys.
Is there a size limit?
There is no fixed limit, but everything happens in your browser tab, so very large inputs (tens of megabytes) get slow in the editor. The output is about a third bigger than the UTF-8 size of your text.
Related Tools
Hex to Base64
Convert hexadecimal data to Base64 encoded strings for APIs and data transmission
Base64 to Hex
Decode Base64 encoded strings to hexadecimal format for cryptography and binary data
Binary to Base64
Encode binary data (0s and 1s) to Base64 format for data transmission
Base64 to Binary
Decode Base64 to binary format (0s and 1s) for debugging and bit-level analysis
ASCII to Base64
Encode ASCII text to Base64 format for embedded systems and protocols
Base64 to ASCII
Decode Base64 to ASCII text for legacy systems and serial communication