URL Encoder / Decoder

Webtools - URL Encoder / Decoder is a simple free online tool that both encodes and decodes URL or Text to Internet friendly format.

What is a URL?

URL stands for Uniform Resource Locator. A URL is a web address of a web resource; specifying its location on a computer network and a mechanism for retrieving it. In theory, each valid URL points to a unique resource like HTML page, a CSS document, an image, etc.

Here are some examples of URL:

  • https://www.webtools.services
  • https://www.webtools.services/resize-browser-window-tool

URL Syntax

Every URL confirms to a generic syntax of a generic URI. The URI generic syntax consists of six components;

  • URI = scheme:[//domain:port]path[?query][#fragment]

To understand syntax further lets consider below sample URL:

  • https://www.example.com:80/path/to/myfile.html?key1=value1&key2=value2#PointerInTheResource

Here:

  • "https" is the schema component
  • "www.example.com" is the domain component
  • "80" is the port component
  • "path/to/myfile.html" is the path component
  • "key1=value1&key2=value2" is the query component
  • "PointerInTheDocument" is the fragment component

As per RFC 1738; URL component names are composed from a smaller subset of US-ASCII character set. These safe characters include digits (0-9), letters (A-Z, a-z), few special characters ("-", ".", "_", "~").

Whereas ASCII control characters (like backspace, vertical tab, horizontal tab, line feed etc), unsafe characters (like space, \, <, >, {, } etc), reserved characters (like ?, /, #, : etc), and characters outside the ASCII set are not allowed to be placed directly within URL component names.

Introduction to URL Encoding (Percentage-Encoding)

URL encoding, also known as percentage-encoding, converts non-ASCII characters, control characters, reserved characters and unsafe characters in URLs to the allowed ASCII characters. During URL encoding characters outside safe character set are first encoded according to the UTF-8 character encoding rules. Then only those bytes that do not correspond to characters in the safe set are replaced with a "%" followed by two hexadecimal digits.

For example, if user tries to access www.modéle.com/dummy page.html page, the browser will automatically URL encode it to www.mod%C3%A8le.com%2Fdummy%20page.html. The Latin é letter is replaced by %C3%A8, reserved character / is replaced by %2F and unsafe character space by %20 respectively.

Purpose of URL Encoding

As per RFC 3986; URL support limited set of US-ASCII characters. These allowed characters include digits (0-9), letters (A-Z, a-z), and few special characters ("-", ".", "_", "~"). But URL often contains characters outside the safe US-ASCII character set, so they must be converted to a valid US-ASCII format so that they can be send safely over internet to locate the resources users are looking for. URL encoding converts all non-conforming characters to safe characters.

URL encoding is also the default encoding for form data. If enctype attribute in form tag is either not present or set to "application/x-www-form-urlencoded" then data encoding is assumed to be URL encoded.

List of URL Unreserved (Safe) Characters

Unreserved (Safe) characters need not to be encoded in URL. Unreserved characters do not have a reserved purposed within URL. RFC 3986 specified unreserved characters are listed below:

012345
6789AB
CDEFGH
IJKLMN
OPQRST
UVWXYZ
abcdef
ghijkl
mnopqr
stuvwx
yz-._~

List of URL Unsafe Characters

Unsafe characters are used to by programs to manipulate URLs, like quote " is used to delimit URLs in some systems; characters "<" and ">" are used as the delimiters around URLs in free text; character "%" is unsafe because it is used for encodings of other characters. All the unsafe characters within URL must always be encoded in URL. RFC 3986 specified unsafe characters are listed below:

Unsafe CharactersEncoded Characters
space%5F
"%22
<%3C
>%3E
%%25
{%7B
}%7D
|%7C
\%5C
^%5E

List of URL Reserved Characters

URL reserved characters are used to delimit URL components. All the reserved characters within URL needs to be encoded in URL. RFC 3986 specified reserved characters are listed below:

Reserved CharactersEncoded Characters
!%21
#%23
$%24
&%26
'%27
(%28
)%29
*%2A
+%2B
,%2C
/%2F
:%3A
;%3B
=%3D
?%3F
@%40
[%5B
]%5D

How to encode and decode a URL?

If you want to URL encode or decode links or text within a program then you are lucky because almost all the popular programming languages provides built in functions for URL encoding and decoding operations. In case you do not want to setup development environment and want a ready utility, then "Webtools - URL Encoder / Decoder" is for you. We built this easy to use, online tool to help you URL encode or decode links anywhere, anytime without any additional setup.

What is %2f in URL?

"%2F" in a URL means / (forward slash) character.

What is %5b in URL?

"%5B" in a URL means [ (opening square bracket) character.

What is %40 in a URL?

"%40" in a URL means @ (at the rate) character.

What is %27 in a URL?

"%27" in a URL means ' (quote) character.

What is %20 in URL?

"%20" in a URL means " " (space).

External Links

More information about percent-encoding (Wikipedia)

More information about URL & URI: RFC 1738 ,RFC 2396 ,RFC 3986

Found an issue, or have feedback?

Help us make "URL Encoder / Decoder" tool better by submitting an issue or a feedback today.