Base64 Encoder
Convert text to Base64, including full Unicode, with an option for the URL-safe alphabet used in JWTs and query strings.
How it works
Base64 takes three bytes at a time and re-expresses them as four printable characters, which is why encoded output is about 33% larger than the input. It is an encoding, not encryption — anyone can decode it.
Text is converted to UTF-8 bytes before encoding, so accented letters, emoji and non-Latin scripts all survive. The naive browser approach throws on those; this does not.
The formula
Encoding
text → UTF-8 bytes → groups of 3 bytes → 4 Base64 characters
Size
encoded length ≈ ceil(bytes ÷ 3) × 4
URL-safe
+ → -, / → _, padding removed
Worked examples
| Scenario | Working | Result |
|---|---|---|
| “Hello” | 5 bytes → 8 characters | SGVsbG8= |
| “café” | é is 2 bytes in UTF-8 | Y2Fmw6k= |
| A value for a URL | URL-safe on | No +, / or = to escape |
When you'd use it
- Embedding a small image or file inline as a data URI
- Putting binary-ish data into a JSON field
- Building a Basic Auth header
- Encoding a value that has to survive a URL intact
Common questions
Is Base64 encryption?
No, and this matters. Base64 is reversible by anyone with no key at all — it is for transport, not secrecy. Never use it to hide a password, token or personal data.
When should I use the URL-safe option?
Whenever the result goes into a URL path, query string or JWT segment. Standard Base64 uses + and /, which have meaning in a URL, and = padding often has to be escaped.
Does it handle emoji and non-English text?
Yes. The text is encoded as UTF-8 first, so anything you can type works — including emoji, which break simpler encoders.

