Coding Ninjas Logo

Home > HTML Questions > Why is a URL encoded in HTML?

Why is a URL encoded in HTML?



Answer:

An URL is encoded to convert non-ASCII characters into a format that can be used over the Internet because a URL is sent over the Internet by using the ASCII character-set only.
If a URL contains characters outside the ASCII set, the URL has to be converted.
The non-ASCII characters are replaced with a “%” followed by hexadecimal digits.


Similar Questions