Base64 Encode
Type, paste, or drop a file below to encode it to Base64 instantly. Files and text never leave your browser.
How to encode to Base64
- Type or paste text into the Text box, or drop a file into it. The Base64 updates as you go.
- Pick the charset that matches your source: UTF-8 covers every character, while ASCII, Latin-1, and UTF-16 are there for legacy data. If the result goes into a link or a filename, turn on the URL-safe alphabet.
- For an email attachment or a MIME body, turn on “Wrap at 76 characters” and set the line ending to LF or CRLF. To keep a multi-line input lined up, turn on “Encode each line separately” so each input line becomes its own Base64 line.
- Copy the result, or download it as a .b64.txt file.
When to use it
Base64 turns bytes into plain ASCII text that survives channels built only for text: a data URI in CSS or HTML, a token or key pasted into a config file, an image inlined into an email. Encoding text or a small file here keeps the bytes on your machine, which matters for anything you’d rather not paste into an online converter.
The MIME wrap and CRLF options exist for the places that still expect them, like email headers and older mail transfer formats that reject lines over 76 characters. For a value going into a URL or a filename, the URL-safe alphabet avoids the “+” and “/” characters that would otherwise need further escaping.
Frequently asked questions
Is my text or file uploaded?
No. Encoding happens entirely in your browser. Your input never leaves the page.
Can I encode files, not just text?
Yes. Type or paste text, or drop a file in; the result can be downloaded as a .b64.txt file.
What does the URL-safe option do?
It produces the RFC 4648 URL-safe alphabet: “+” and “/” become “-” and “_”, and the “=” padding is dropped, so the result is safe in URLs and filenames.
Why does it say a character can’t be represented?
The character doesn’t exist in the chosen charset, e.g. an emoji under ASCII. Switch the charset to UTF-8, which covers any character.