Toolsel

Base64 Encoder / Decoder

Runs in your browser

Encode text to Base64 or decode it back, with full Unicode support.

Plain text

Base64

What is a Base64 Encoder / Decoder?

Base64 represents arbitrary bytes using only 64 printable ASCII characters. It exists because plenty of systems — email bodies, HTTP headers, JSON string fields, data: URLs — can carry text reliably but mangle raw binary. Encoding costs about 33% extra size in exchange for surviving that trip intact.

Base64 is not encryption and provides no security whatsoever. Anyone can decode it in a second, as this page demonstrates. It is an encoding for transport, in the same family as URL encoding and quoted-printable.

Base64url is a small variant used in JSON Web Tokens and URLs: it swaps the + and / characters for - and _ so the result is safe to place in a query string or path segment, and usually drops the = padding.

How to use it

  1. Pick a direction — Encode turns text into Base64, Decode turns Base64 back into text.
  2. Type or paste into the input panel. The result updates as you type.
  3. Switch on URL-safe (Base64url) if the output has to travel in a URL or you are working with JWT segments.
  4. Use the swap button to move the output into the input, which makes round-tripping easy to verify.
  5. Copy the result, or download it when the output is long.

Examples

Encoding

Input
Hello, world!
Output
SGVsbG8sIHdvcmxkIQ==

Unicode round-trip

Input
café ☕
Output
Y2Fmw6kg4piV

Frequently asked questions

Is Base64 encryption?
No. It is a reversible encoding with no key and no secret. Encoding a password in Base64 gives you exactly the same security as writing it in plain text. Use it for transport, never for protection.
Why does JavaScript's btoa() break on non-English text?
btoa() only accepts characters in the 0-255 range, so anything above Latin-1 — accented letters, CJK characters, emoji — throws an InvalidCharacterError. The fix is to convert the string to UTF-8 bytes first with TextEncoder, then Base64 those bytes. This tool does that, so "café" and "☕" encode and decode correctly.
What are the = signs at the end?
Padding. Base64 works on three-byte groups producing four characters; when the input length is not a multiple of three, one or two = characters pad the final group. Base64url commonly omits padding, and most decoders accept it either way.
When should I use URL-safe Base64?
Whenever the value goes into a URL path, query string or filename. Standard Base64 uses + and /, which have reserved meanings in URLs and would need percent-encoding on top. Base64url avoids the problem by using - and _ instead.
How much larger does Base64 make my data?
Roughly one third. Every three bytes become four characters, so a 300 KB image becomes about 400 KB as a data: URL. That trade-off is worth it for small assets, but inlining large files this way hurts page performance.