URL Encode

URL Encode

convert your string to URL encoded format

About URL Encoder

URL Encoder is a simple and easy to use online tool for encoding URLs. You just need to type or paste a string in the input text area, the tool will automatically convert your string to URL encoded format in real time. Once the URL is encoded, you can click in the output text area to copy the encoded URL. Note that, our tool uses UTF-8 encoding scheme for encoding URLs. The world wide web consortium recommends that UTF-8 should be used for encoding.

What is URL encoding or Percent Encoding?

URLs in the world wide web can only contain ASCII alphanumeric characters and some other safe characters like hyphen (-), underscore (_), tilde (~), and dot (.).

Alphabets   /   Digits   /   "-"   /   "_"   /   "~"   /   "."

Any other character apart from the above list must be encoded.

URL encoding, also known as percent encoding, is a way to encode or escape reserved, unprintable, or non-ASCII characters in URLs to a safe and secure format that can be transmitted over the internet. It is also used in preparing data for submitting HTML forms with content-type application/x-www-form-urlencoded.

How does URL encoding work?

URL Encoding works like this - It first converts the character to one or more bytes. Then each byte is represented by two hexadecimal digits preceded by a percent sign (%) - (e.g. %xy). That gives us the URL encoded value.

The percent sign is used as an escape character that's why we also refer to URL encoding as Percent encoding.

Percent Encoded = "%" HEXDIG HEXDIG

For instance, Let's understand how to URL encode the character @. To encode @, we first convert it into a sequence of bytes using its ASCII value. The ASCII value of @ in decimal is 64 which when converted to hexadecimal comes out to be 40. We then precede the hex value with percent sign, which gives us the final URL encoded value %40.