Skip to main content

Text to Base64 Encode

Encode text to a Base64 string. Handles any UTF-8 content — URLs, CSS, HTML, XML, JavaScript, accented characters and emoji — and runs entirely in your browser.

Input

Drop a file or browse
One file · text
Or

Tip: can be any text or string — URL, CSS, HTML, XML, JavaScript, emoji. The whole input (newlines included) is encoded as one Base64 value.

Output

Base64 output
Was this helpful?

Guides

Convert any text to a Base64 string, instantly and in your browser. Paste a URL, a snippet of CSS, HTML, XML or JavaScript, a JSON payload, an API token, a certificate body or a paragraph of plain prose — the Base64 encoding appears as you type, ready to copy into a header, a data URI, a config file or an email.

How to use it

  1. Paste or type your text into the input box, or upload a text file with the uploader — its contents drop straight into the editor.
  2. The Base64 output updates automatically.
  3. Copy it, or download it as a .txt file.

The entire input is encoded as one Base64 value, newlines included — so what you paste is exactly what comes back out when it is decoded.

Does it handle emoji and accented characters?

Yes. The text is UTF-8 encoded before it is Base64-encoded, so é, , 日本語 and 🚀 all survive the round trip. This matters: the naive browser approach (btoa() on a raw string) throws an error on any character above U+00FF, which is why so many quick Base64 snippets break the moment a user pastes a curly quote.

What is Base64, and why use it?

Base64 represents arbitrary bytes using 64 safe ASCII characters (A–Z, a–z, 0–9, +, /, with = padding). It exists so binary or non-ASCII data can travel through channels that only reliably carry plain text: HTTP headers, data: URIs, JSON fields, XML documents, email bodies (MIME) and environment variables. Every three bytes become four characters, so expect the output to be roughly 33% larger than the input.

Is Base64 encryption?

No — and this is the single most common misconception. Base64 is an encoding, not a cipher: it has no key, and anyone can decode it in one step. Never use it to protect a password, a token or personal data. It only makes bytes transport-safe.

How do I decode Base64 back to text?

Use the Base64 Decode tool. It is the exact inverse of this one: text encoded here decodes back to the identical string, emoji and all.

Is my text private?

Yes. Encoding runs entirely in your browser — your text is never sent to a server, never logged and never stored. You can safely encode sensitive strings, and you can even use the tool offline once the page has loaded.

Can I Base64-encode a file?

For images, PDFs and other binary files, use the File to Base64 converter, which produces a data URI. This tool is for text.

base64encodeencodingtextdeveloper

Part of a workflow

All collections

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.