How to convert TXT to Base64
- Drop your TXT file on the box above, or paste its content into the text box.
- Check the settings below the box; the defaults suit most files.
- Press Convert. You see a preview or a summary of the result.
- Download the .txt file, or copy the text.
What is kept when you convert TXT to Base64
- Typed text is encoded as UTF-8 bytes; a loaded file is encoded byte for byte, whatever its encoding.
- Choose standard Base64, URL-safe Base64 (- and _ without padding), 76-character MIME lines, or a complete data: URI.
- Decoding the result gives back exactly the original bytes.
Example
A short TXT input and the exact output this tool produces from it:
Input
Hello, wörld! Output
SGVsbG8sIHfDtnJsZCE=
About TXT and Base64 files
A .txt file is plain text: characters and line breaks, with no fonts, sizes or layout. It is what Notepad, TextEdit, code editors and many export buttons produce. It opens in any text editor.
Base64 writes any bytes using 64 safe characters (A–Z, a–z, 0–9, + and /), so data can travel inside JSON, email, HTML or URLs. It is an encoding, not encryption: anyone can decode it. It opens in any text editor; decoded by every programming language.
Good to know
- If accented letters show up as é or ?, the text file was saved in an older Windows encoding; this tool reads UTF-8 and falls back to Windows-1252 automatically, so open the result and check one accented word.
- Base64 makes data about a third bigger, so embed only small files; link to larger ones instead.
Privacy and limits
The file is read and converted by this page in your browser; there is no upload and no account. Files up to 25 MB are accepted; a file of the wrong type or a damaged file is rejected with the reason.