base64-converter
Encode text to Base64, or decode Base64 back to plaintext. Handles UTF-8 correctly (accents, emoji, non-Latin scripts) and supports the URL-safe variant used in JWTs and query strings.
client-side only UTF-8 safe URL-safe variant
input
Drag & Drop a file here to convert to Base64, or click to upload.
output
Result appears here.
// UTF-8 handling
// when you need the URL-safe variant
- Standard Base64 uses
+,/, and=padding — all three have special meaning in URLs and need escaping if used in a query string or path segment. - URL-safe Base64 replaces
+with-and/with_, and drops the=padding entirely — this is exactly the encoding used in JWT segments and many API tokens. - The two variants encode different symbols for the same bytes — always decode with the same variant that was used to encode, or decoding will fail or produce garbage.
The browser's built-in
btoa()/atob()only handle Latin-1 (single-byte) text and throw on anything outside that range — meaning accented characters, emoji, or non-Latin scripts break them directly. This tool encodes text as UTF-8 bytes first, then Base64-encodes those bytes, matching howConvert.ToBase64String(Encoding.UTF8.GetBytes(...))behaves in .NET — so text round-trips correctly regardless of character set.