About the Base64 & URL Encoder
This tool handles two encodings. Base64 (RFC 4648) represents bytes with 64 printable characters, used in data URIs, email and HTTP Basic auth. Text is encoded as UTF-8 first, so emoji round-trip correctly. The URL-safe option uses the base64url alphabet (- and _ instead of + and /) and drops = padding, as JWTs do. When decoding, whitespace is ignored, missing padding is added, and both alphabets are accepted. If the decoded bytes aren't valid UTF-8, they are shown as hex with a warning.
URL mode applies percent-encoding. Component uses encodeURIComponent, escaping / ? & = too, for a single query value. Full URL uses encodeURI, which keeps the URL's structure. Decoding treats + as a space. Everything runs in your browser.
How to use it
- Choose Base64 or URL, then Encode or Decode.
- Type or paste your input; the output updates as you type.
- Copy the result, or click Use output as input to reverse it.
Examples
- Encode a short string: produces
SGVsbG8sIHdvcmxk. - Decode Base64 text: gives back
Hello, world. - Decode a JWT header: an unpadded base64url segment decodes to
{"alg":"HS256"}.
Common questions
Is Base64 encryption?
No. It is a reversible encoding with no key; anyone can decode it. Don't use it to hide secrets.
Why is Base64 output longer than the input?
Every 3 bytes become 4 characters, so encoded data is about 33% larger; = pads the last group to 4 characters.
Why do I get "Invalid Base64 input"?
The text has characters outside the Base64 alphabets, or an impossible length, often from a truncated copy.
Component or Full URL?
Use Component for a single query value or path segment. Use Full URL for a complete address whose ? and & must stay intact.
Related tools
- JWT Decoder: decode all three parts of a token at once.
- URL Parser: split a URL into parts and edit query parameters.
- HTML Entity Encoder / Decoder: escape text for HTML instead of URLs.