Base64 encoder

Type your text and encode it as standard or URL-safe Base64, accents and emoji included.

Base64 is not encryption: anyone can decode it. URL-safe mode swaps + for -, / for _ and drops the = padding. It all runs in your browser: your text is never uploaded.

Example input and result

Hello 👋

Result

SGVsbG8g8J+Riw==

How to Base64 encode text

Type or paste into “Your text” and the Base64 version appears in “Result” as you type. Hello becomes SGVsbG8=. “Mode” switches between “Standard Base64” and “URL-safe Base64”. The output is one unbroken line with no wrapping, ready for “Copy result” or “Download TXT”. To turn a string back into the original text, use the Base64 decoder.

Standard Base64 or URL-safe Base64

Both modes carry the same bytes with a different alphabet. “Standard Base64” uses +, / and = padding, the form most libraries and config files expect. “URL-safe Base64” swaps + for - and / for _ and drops the trailing =, since those characters have special meanings inside a link and can get mangled on the way.

  • Hello 👋 in standard: SGVsbG8g8J+Riw==; URL-safe: SGVsbG8g8J-Riw
  • Hi? in standard: SGk/; URL-safe: SGk_
  • Hello in standard: SGVsbG8=; URL-safe: SGVsbG8

Why Base64 output is longer, and when padding appears

Base64 reads bytes three at a time and writes each group as four characters, so the output runs about a third longer than the input. If one byte is left over at the end you get ==, and if two are left you get =. That's why a encodes to YQ==, ab to YWI= and abc to YWJj. Accented letters and emoji take several UTF-8 bytes, so they grow the result faster.

Invisible characters count too. Every space and line break gets encoded, so Hello gives SGVsbG8= but Hello followed by Enter gives SGVsbG8K. If your string doesn't match what a program or a test expects, check for a trailing space or an empty last line before anything else.

Common reasons to Base64 encode text

Base64 turns any text into letters, digits and a few safe symbols, so it travels through places that choke on accents, quotes or line breaks. It hides nothing from anyone who wants to read it, so treat it as packaging for your data rather than a lock.

  • Putting text with accents or line breaks into JSON, a config file or an environment variable
  • Building an HTTP Basic auth header: user:pass encodes to dXNlcjpwYXNz
  • Passing a value inside a URL with “URL-safe Base64”
  • Test fixtures for an API or a coding exercise
  • Hiding a spoiler or a puzzle answer from a casual glance

Frequently asked questions

How do I Base64 encode a string?

Type or paste the text into the box and copy the result. Hello becomes SGVsbG8=. If the value goes inside a link, switch “Mode” to “URL-safe Base64” before you copy, so the output has no +, / or = characters.

Can Base64 protect a password?

No. Base64 is an encoding, not encryption: there's no key, and any decoder reverses it in seconds. Use it to move data as text. For passwords, use a password manager or proper encryption instead.

What's the difference between standard and URL-safe Base64?

Standard Base64 uses + and / and ends with = padding. URL-safe output swaps + for - and / for _ and leaves off the padding, so the string won't break inside a link. Use whichever format the program reading the value asks for.

Why doesn't my result match another encoder?

The usual cause is a trailing space or line break, which gets encoded too. Character encoding also matters: this tool turns text into UTF-8 bytes before encoding, so a program that uses Latin-1 or Windows-1252 gives a different result for accented letters.

Does it work with emoji and accented letters?

Yes. Text is converted to UTF-8 first, so accents, ñ and emoji survive the round trip. Café encodes to Q2Fmw6k=, and the Base64 decoder turns that string back into Café with the accent intact.

Copied text!