Base64 Converter (Text)

Convert text to Base64 and back - free, UTF-8 safe.

Base64 converter
Direction
Base64

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

  1. Choose Text to Base64 or Base64 to text.
  2. Type or paste your content.
  3. 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

Input and output of Base64 Converter (Text)
ItemDetails
InputText, or a Base64 string to decode.
OutputThe converted text with size counts.
NotesStandard Base64 alphabet, with or without padding.

Issues you may run into

Common problems with Base64 Converter (Text)
What you seeWhy it happensWhat to do
Decoding failsThe string contains invalid characters or is truncated.Check for stray spaces or quotes.
Output is 33% largerBase64 expands data.This is normal.
A file is expectedThis converts text.Use the image Base64 tools for files.

Assumptions and limitations

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 /.