Encoders and decoders
Binary-to-text and URI escaping, done correctly
Encoding is where "it works when I paste it" stops being good enough. Base64 has two alphabets, optional padding, a canonical-form rule most decoders ignore, and line wrapping that belongs to MIME and PEM rather than the data; percent-encoding depends entirely on which component of a URI you are writing into, so the same value needs different escapes in a path, a query value and a form body. Both pages make those differences visible instead of picking one behaviour silently.
- The decoder recognises base64url by its characters, unpacks JWT segments, reads the MIME type off magic bytes and warns when trailing bits are not zero (RFC 4648 §3.5).
- Percent-encoding offers component, path, query-value, whole-URI and form modes, because encodeURIComponent is wrong for a query value containing "&" and for a path containing "/".
- Both pages normalise rather than merely translate: uppercase hex digits and literal unreserved characters per RFC 3986 §6.2.2.1, so equivalent URLs compare equal.
2 tools in this column
Questions people ask before converting
Is base64 encryption?
No, and treating it as such is a recurring source of leaked secrets. RFC 4648 describes a binary-to-text encoding: a reversible, keyless transformation with 64 symbols, so any valid value decodes without credentials. It exists to carry bytes through a channel that only accepts text — an email part, a JSON string, a URL segment, a PEM block. Anything genuinely private needs an authenticated cipher; base64 only changes the character set.
Why did my URL stop working after encoding it?
Usually because delimiters were encoded, or were not. RFC 3986 §2.2 reserves : / ? # [ ] @ ! $ & ' ( ) * + , ; = for their structural roles, so a "?" inside a query value must become %3F or the value ends early, while the "?" that starts the query must stay raw or the whole URL becomes one path. Component mode escapes "/" and turns a route-style value into %2F, which IIS and Apache normalise before routing and therefore reject. Pick the mode that matches the component you are writing.
What is the difference between base64 and base64url?
Same 6-bit packing, two alphabets. RFC 4648 §4 uses "+" and "/"; both are unsafe in URLs and filenames — "+" decodes to a space in a query string — so §5 replaces index 62 with "-" and index 63 with "_". JWTs (RFC 7515) additionally omit the "=" padding. A decoder that assumes the standard alphabet corrupts any base64url value containing "-" or "_", which is why the decode tab detects the alphabet from the characters present.