Toolhaus

Base64 Encoder & Decoder

Encode text to Base64 or decode Base64 back to text, with URL-safe support.

Convert text to and from Base64. Handles full Unicode correctly and offers a URL-safe variant. Everything runs locally — nothing is uploaded.

Output
—

Paste your text into the input box, then choose Encode or Decode. When encoding, tick URL-safe if the result will be placed in a URL, filename, or cookie — this swaps the + and / characters for - and _ and drops the trailing = padding. Decoding accepts both the standard and URL-safe variants automatically, so you never need to toggle anything to read a URL-safe string back.

Formula & methodology

Text is UTF-8 encoded to bytes, then mapped to the Base64 alphabet (or the URL-safe variant). Decoding reverses the process.

Worked example

  • hello → aGVsbG8=

Common mistakes

  • Treating Base64 as encryption — it is not. Anyone can decode it instantly; it only converts binary-safe data into printable text for transport, it does not hide or protect it.
  • Pasting standard Base64 output straight into a URL, filename, or cookie value, where the +, /, and = characters can break parsing — that is exactly what the URL-safe option is for.
  • Feeding text that is not actually valid Base64 into Decode and expecting clean output — invalid input throws an error rather than silently returning garbage.

Frequently asked questions

Is Base64 encryption?

No. Base64 is an encoding, not encryption. It provides no confidentiality.

Does it support Unicode?

Yes, input is UTF-8 encoded so emoji and non-Latin scripts round-trip correctly.

When do I need the URL-safe variant?

Use it whenever the encoded string will end up inside a URL, a filename, or an HTTP cookie. Standard Base64 uses +, /, and = which have special meaning in those contexts; URL-safe mode replaces + and / with - and _ and omits the = padding so the string passes through untouched.

Can I encode images or files with this tool?

This tool works on text you paste in, not file uploads. You can still Base64-encode a file’s contents (for example a data URI) elsewhere and paste the resulting text here to decode or re-encode it, but there is no file picker.

Why did decoding fail on my input?

Decoding throws an error if the text is not valid Base64 — for example it contains characters outside the Base64 alphabet, or has an incorrect length after removing padding. Check that you copied the entire string, including any trailing = signs from a standard (non-URL-safe) value.

Privacy

All processing happens locally in your browser. Your data is never uploaded.

Read the practical guide for this category.

Related tools