Base64 Encoder
Encode text or bytes to Base64 or Base64URL.
Paste text on the left.
How it works
Base64 carries arbitrary bytes through channels that only accept text — a mail body, a JSON string, a URL, an HTTP header. Three bytes become four characters drawn from a 64-character alphabet, which is where the name and the roughly 33% size increase both come from.
Which alphabet
Standard Base64 uses + and /. Both mean something else in a URL, so Base64URL
substitutes - and _ and the value survives unescaped in a path, a query or a filename.
JWTs use Base64URL for exactly this reason.
Padding
Trailing = rounds the output to a multiple of four. It carries no information, which is why Base64URL
omits it by specification and why removing it is lossless — though some strict parsers still want it.
Non-ASCII
Text is encoded to UTF-8 bytes before those bytes are Base64-encoded. That is what every standard expects, and it is why an accented character or an emoji round-trips through the Base64 Decoder unchanged rather than arriving mangled.
Example
abc encodes to YWJj — three bytes, four characters, no padding needed. Drop a character
and ab becomes YWI=; drop another and a becomes YQ==. The
padding count is a direct readout of how the input length divided by three.
Frequently asked questions
When should I pick Base64URL over standard Base64?
When the result goes in a URL, a filename or a JWT. Standard Base64 uses + and /, which mean something else in a URL path or query; Base64URL substitutes - and _ so the value survives unescaped.
How is non-ASCII text handled?
Text is encoded to UTF-8 bytes first, then those bytes are Base64-encoded. That is what every standard expects, and it is why an emoji or an accented character round-trips through the decoder unchanged.
Why would I turn padding off?
Base64URL omits trailing = by specification, and some parsers reject it. Padding carries no information — it only rounds the output to a multiple of four — so removing it is lossless.
Related tools
Base64 Decoder
Decode Base64 and Base64URL back to text or raw bytes.
LocalURL Encoder
Percent-encode text for a URL path, query value or component.
LocalHex ↔ ASCII Converter
Convert between hex byte sequences and readable text.
LocalBinary, Decimal & Hex Converter
Convert a number between binary, octal, decimal and hexadecimal.
LocalHTML Entity Encoder & Decoder
Convert between raw characters and HTML entity references.
LocalUnicode Inspector
See the real code points, UTF-8 bytes and normalization forms behind any pasted text.
Local