GreyScript AI

URL and Base64 Encoder/Decoder

Encode or decode text as URL (percent-encoded) text or Base64, in either direction. Handles full Unicode text correctly, with an optional URL-safe Base64 alphabet.

Encoding
Text
Result
Encoding and decoding run entirely in your browser using standard JavaScript functions. Nothing you enter is sent anywhere or saved.

Questions and answers

What is the difference between encodeURIComponent and encodeURI?

encodeURIComponent escapes every character that is not safe in a single URL part, including &, = and /, so it is correct for a query parameter value. encodeURI leaves characters that are structurally part of a URL, such as :/?&=, untouched, so it is meant for encoding a whole URL rather than one piece of it.

What is URL-safe Base64?

Standard Base64 uses + and /, which have special meaning inside a URL, plus = padding at the end. URL-safe Base64 (also called Base64url) replaces + with -, / with _, and drops the padding, so the result can be used directly in a URL or filename.

Why did decoding fail?

For Base64, the input has to be a valid Base64 string of the right length; stray characters or truncated text will fail. For URL decoding, a % must always be followed by two hex digits; text that is not actually percent-encoded will fail to decode.

Does it handle non-English text and emoji correctly?

Yes. Base64 encoding goes through UTF-8 bytes first, so accented letters, non-Latin scripts and emoji round-trip correctly rather than becoming garbled text.

Is my text uploaded anywhere?

No. Encoding and decoding use your browser's own built-in functions and run entirely on your device. Nothing is sent to a server or saved.