Base64 Converter (Text)
Convert text to Base64 and back - free, UTF-8 safe.
What this tool does
Switch between Text to Base64 and Base64 to text, type or paste your content, and see the conversion instantly. Text is encoded as UTF-8 bytes before being Base64-encoded, which is why accented letters, symbols and emoji convert correctly - a converter built on plain btoa() alone breaks the moment a character falls outside the first 256 code points.
Converts text to Base64 by encoding it as UTF-8 bytes first, correct for accented letters, symbols and emoji, not just plain ASCII.
Converts Base64 back to text the same way, decoding the byte sequence as UTF-8.
Shows character counts and the size change between input and output.
Uses the standard 64-character Base64 alphabet (A-Z, a-z, 0-9, + and /) with = padding to a multiple of 4 characters, not the URL-safe variant that swaps in - and _ and drops padding.
How to use it
- Choose Text to Base64 or Base64 to text.
- Type or paste your content.
- Copy the result.
Why use this converter
Base64 appears in emails, APIs, tokens and data URIs. Encoding text as UTF-8 first makes the result correct for accents and emoji, which a naive converter breaks.
Why we built it
We built the Base64 converter to encode through UTF-8 bytes, unlike a naive conversion that fails on accented letters and emoji. Decode URLs with the URL encoder and decoder and inspect tokens with the JWT decoder.
Handy alongside this: the Hex Code Translator, the Image to Base64 Converter and the ROT13 Translator.
Who this tool is for
- Developers handling data URIs and tokens
- Students learning encodings
- Support staff decoding a string
When to use it
- Encoding text to put it in JSON, HTML or a URL.
- Decoding a Base64 string from an API or log.
- Checking size overhead of Base64.
- Debugging data in a request.
Why plain btoa() isn't enough
The browser's built-in Base64 function throws on most non-English text.
JavaScript's built-in btoa() function encodes a string directly, but it throws an error the moment a character falls outside the first 256 Unicode code points - which includes almost any accented letter, emoji, or non-Latin script character. This tool encodes your text as UTF-8 bytes first, then Base64-encodes those bytes, which is the standard, correct way to Base64-encode arbitrary text and the reason this handles far more than plain English.
Why Base64 output is always longer than the input
Every 3 bytes of input becomes 4 output characters - a fixed, unavoidable ratio.
Base64 packs 3 bytes (24 bits) of input into 4 output characters, each one carrying 6 bits of that data from a fixed 64-character alphabet - the 26 uppercase and 26 lowercase Latin letters, the 10 digits, plus + and /. Because 4 output characters always represent 3 input bytes, the result is roughly one-third larger than the input, and when the input length isn't an exact multiple of 3, one or two '=' padding characters are appended so the output length is always a multiple of 4. That size increase isn't a flaw a better converter could avoid - it's the fixed cost of turning arbitrary binary data into text made only of safe, printable characters.
What you give it, and what you get back
| Item | Details |
|---|---|
| Input | Text, or a Base64 string to decode. |
| Output | The converted text with size counts. |
| Notes | Standard Base64 alphabet, with or without padding. |
Issues you may run into
| What you see | Why it happens | What to do |
|---|---|---|
| Decoding fails | The string contains invalid characters or is truncated. | Check for stray spaces or quotes. |
| Output is 33% larger | Base64 expands data. | This is normal. |
| A file is expected | This converts text. | Use the image Base64 tools for files. |
Assumptions and limitations
- Base64-to-text mode expects standard Base64 (with or without padding); malformed input is flagged rather than silently producing garbage.
- This encodes and decodes text specifically - for encoding a file's raw bytes, use a file-focused Base64 tool instead.
Frequently asked questions
How do I convert text to Base64 online for free?
Choose Text to Base64, type your text, and the Base64 result appears instantly.
Does this handle emoji and accented letters?
Yes - it encodes to UTF-8 bytes before Base64-encoding, which is why multi-byte characters like emoji and accented letters convert and decode correctly, unlike a converter built on plain btoa() alone.
Can I convert Base64 back to text?
Yes - switch to Base64 to text, paste your Base64 string, and the decoded text appears instantly.
Why did I get an error or garbled text?
This usually means the input wasn't valid Base64 - check for missing characters, extra whitespace, or an incomplete string.
Is my data uploaded anywhere?
No. Conversion happens entirely in your browser - nothing is sent to a server.
Why is the Base64 output longer than my original text?
Base64 encodes 3 bytes of input as 4 output characters, so the result is roughly a third longer than the input - and gets padded with one or two '=' characters when the input length isn't a multiple of 3.
What characters actually appear in Base64 output?
The standard 64-character alphabet: uppercase A-Z, lowercase a-z, the digits 0-9, plus + and /, with = used only for padding at the end. This tool uses that standard alphabet, not the URL-safe variant that swaps in - and _ for + and /.