Base64 Encoder & Decoder

Encode text to Base64 or decode Base64 back to text, with full UTF-8 and URL-safe support. Runs entirely in your browser โ€” nothing is uploaded.

Base64

SGVsbG8sIFNjb3V0TXlUb29sISDwn5ug77iP

About this tool

Base64 encodes arbitrary bytes as a 64-character alphabet (Aโ€“Z, aโ€“z, 0โ€“9, + and /) so binary or non-ASCII data can travel safely through text-only channels like JSON, URLs, email headers, and data URIs. This tool encodes any text โ€” including emoji and other Unicode โ€” by first converting it to UTF-8 bytes, so multi-byte characters round-trip correctly, which the naive browser btoa() function cannot do on its own. Decoding reverses the process and validates that the result is well-formed UTF-8, surfacing an error rather than silently producing garbage. A URL-safe option swaps + and / for - and _ and drops the trailing = padding, matching the base64url variant used in JWTs and many web APIs. Everything happens locally in your browser; the text you paste is never sent anywhere.

How to use it

  • Choose Encode or Decode.
  • For encoding, optionally tick URL-safe to get the base64url variant.
  • Paste or type your input.
  • Copy the result from the output panel.

Frequently asked questions

Does this handle emoji and non-English text?
Yes. Text is encoded to UTF-8 bytes before Base64 and decoded back the same way, so emoji, accented characters, and any Unicode round-trip exactly. The plain browser btoa() function breaks on such characters; this tool does not.
What is "URL-safe" Base64?
It is the base64url variant from RFC 4648: the + and / characters are replaced with - and _, and the = padding is removed. This makes the string safe to drop into a URL or filename without escaping. It is the encoding used by JWT tokens.
Why do I get an error when decoding?
Either the input is not valid Base64 (wrong characters or length), or the decoded bytes are not valid UTF-8 text. The tool decodes URL-safe input automatically and re-adds missing padding, so the most common cause is a stray or truncated string.
Is Base64 a form of encryption?
No. Base64 is an encoding, not encryption โ€” anyone can decode it. It only changes the representation of data so it survives text channels; it provides no confidentiality. Never use it to "hide" secrets.
How much larger does Base64 make my data?
About 33% larger: every 3 bytes of input become 4 Base64 characters. That overhead is the price of representing binary data in a restricted text alphabet.
Is my input uploaded anywhere?
No. Encoding and decoding run entirely in your browser with no network calls, so even sensitive text or tokens stay on your machine.

Related tools