URL Encoder/Decoder

What is URL Encoding?

URL encoding, also known as percent-encoding, is a method to encode information in a Uniform Resource Identifier (URI). It ensures that all characters sent in a URL are valid and will be correctly interpreted by web servers and browsers.

URLs can only be sent over the internet using the ASCII character-set. Since URLs often contain characters outside the ASCII set, the URL needs to be converted into a valid ASCII format. URL encoding replaces unsafe ASCII characters with a "%" followed by two hexadecimal digits.

Example:

A common character that needs encoding is the space. If you have a search query like "my test", it needs to be encoded to be safely included in a URL.

  • Before: https://example.com/search?q=my test
  • After: https://example.com/search?q=my%20test

This tool uses the standard encodeURIComponent() and decodeURIComponent() JavaScript functions to perform this conversion, making it safe to include any text in a URL path or query parameter.