URL Encoder / Decoder

Enter the text that you wish to encode or decode:



About URL Encoder / Decoder

What is URL Encoding?

URL encoding is a process that converts characters into a format that can be sent over the Internet. On the Internet, URLs can only be sent using ASCII characters. URLs often contain characters outside the ASCII set, so the URL must be converted into a valid ASCII format. URL encoding replaces unsafe ASCII characters with a "%" followed by two hexadecimal digits.

Why we need URL Encoding?

  • There are times when you need to pass characters that are invalid for URLs, such as " < > # % | ^ [ ] ` spaces. For example, whitespace is not a valid URL character, since it would be difficult to see the full URL in texts with whitespace.
  • When you need to pass reserved characters for URL, such as ! # $ % & ' ( ) * + , / : ; = ? @ [ ]. For example, ? is reserved to mark the start of query parameters, and if we do not encode ? in the path or inside query parameter, it might break the syntax.

When and why would you use URL encoding?

When data that has been entered into HTML forms is submitted, the form field names and values are encoded and sent to the server in an HTTP request message using method GET or POST, or, historically, via email. The encoding used by default is based on a very early version of the general URI percent-encoding rules, with a number of modifications such as newline normalization and replacing spaces with "+" instead of "%20". The MIME type of data encoded this way is application/x-www-form-urlencoded, and it is currently defined (still in a very outdated manner) in the HTML and XForms specifications. In addition, the CGI specification contains rules for how web servers decode data of this type and make it available to applications.

When sent in an HTTP GET request, application/x-www-form-urlencoded data is included in the query component of the request URI. When sent in an HTTP POST request or via email, the data is placed in the body of the message, and the name of the media type is included in the message's Content-Type header.