Skip to content
ToolBoxGenie

Base64 Encoder / Decoder

Developer Tools ยท Added 13 July 2026

Convert text to Base64 and back. Unlike the browser's built-in btoa, this handles the full Unicode range correctly, so emoji and non-Latin scripts survive the round trip. A URL-safe mode swaps the problematic characters for use in query strings and JWTs.

Direction
Encoding options

How to use the base64 encoder / decoder

  1. 1Choose Encode or Decode.
  2. 2Paste your text or your Base64 string.
  3. 3Switch on URL-safe mode if the output will go into a URL or a JWT.
  4. 4Copy the result โ€” the conversion happens as you type.

Examples

Encoding

Input
Hello, world!
Result
SGVsbG8sIHdvcmxkIQ==

Unicode round trip

Input
ใ“ใ‚“ใซใกใฏ ๐Ÿ‘‹
Result
44GT44KT44Gr44Gh44GvIPCfkYs= โ€” decodes back to the original exactly

About the base64 encoder / decoder

Where Base64 legitimately belongs

Email attachments, HTTP Basic authentication headers, data URIs for tiny inline assets, binary fields inside JSON, and the payload sections of JSON Web Tokens. The common thread is a channel that only reliably carries text.

It does not belong in a database column that could hold bytes, in a password field, or anywhere the 33 percent size penalty is paid for no reason.

Decoding safely

A Base64 string from an untrusted source is untrusted data after decoding too. Decoding a JWT payload here is a perfectly good way to see what a token claims โ€” but seeing the claims is not the same as verifying the signature, and an unverified token proves nothing.

As a general rule, use this tool to inspect and debug. Never use a decoded value in a security decision without validating it through the proper channel.

Frequently asked questions

Is Base64 encryption?
No, and treating it as such is a security mistake. Base64 is a reversible encoding with no key. Anyone can decode it instantly. It exists to move binary data safely through text-only channels, not to hide anything.
Why does btoa fail on non-ASCII text?
The browser's btoa only accepts characters in the Latin-1 range, so anything above code point 255 throws. This tool encodes to UTF-8 bytes first, which is why emoji and Japanese text work here and not in a bare console call.
What is URL-safe Base64?
Standard Base64 uses '+' and '/', both of which have meaning in URLs, and '=' padding, which is awkward in path segments. The URL-safe variant substitutes '-' and '_' and usually drops the padding. JSON Web Tokens use it throughout.
How much larger does Base64 make data?
About 33 percent, since every three bytes become four characters. Line wrapping for MIME adds a little more. This overhead is why inlining large images as Base64 data URIs is usually a poor trade.