0

Decoded

URL Encoding

Encoded

URL Encoding
Space

About URL Encoding

URL encoding is an encoding method for safely representing text in URLs. Its formal name is "percent-encoding", defined by the URI specification RFC 3986.

Characters that have special meaning in URLs, or characters that are difficult to handle as-is in URLs, are converted to a percent sign (%) followed by two hexadecimal digits.

For example, a space is represented as %20, an exclamation mark (!) as %21, and the Japanese character "あ" as %E3%81%82 in UTF-8.

URL encoding first converts text to bytes using the selected character encoding, then represents each byte as %HH when needed. In DenCode, the RFC 3986 unreserved characters, alphanumeric characters and -, ., _, ~, are not converted, and the other characters are percent-encoded.

CharacterAfter URL EncodingDescription
AAAlphanumeric characters are unreserved characters, so they are not converted.
---, ., _, and ~ are unreserved characters, so they are not converted.
/%2FThis character separates URL path segments, so encode it when it is used as a value.
?%3FThis reserved character starts the query string.
&%26This reserved character separates query parameters.
=%3DThis reserved character separates a query parameter name and value.
Space%20In URL percent-encoding, a space is encoded as %20; in application/x-www-form-urlencoded, it is encoded as +.
+%2BEncode + when the plus sign itself is used as a value.
%E3%81%82In UTF-8, this character is encoded as a three-byte sequence.

For example, URL encoding "Hello, world!" gives the following result.

Hello%2C%20world%21

In this example, the comma (,) becomes %2C, the space becomes %20, and the exclamation mark (!) becomes %21.

Space Representation in application/x-www-form-urlencoded

In application/x-www-form-urlencoded, used for HTML form submission, spaces may be represented as +. This format is defined as the form submission encoding in the HTML Standard.

DenCode lets you choose whether spaces are output as %20 or + when encoding.

FormatResult for "Hello world"Use
Percent-encodingHello%20worldA general-purpose form for URLs.
application/x-www-form-urlencodedHello+worldUsed in HTML form query strings and request bodies.