CoderTools

URL Encoder/Decoder | CoderTools

Description

About URL Encoding

URL encoding, also known as percent encoding, is a mechanism to encode information in a Uniform Resource Identifier (URI) under certain circumstances. It consists of substituting certain characters with one or more character triplets that consist of the percent character '%' followed by two hexadecimal digits.

URL encoding is necessary when a URL contains characters that are not allowed in URLs, or when characters have special meaning in URL syntax. This ensures that URLs can be safely transmitted over the internet regardless of the characters they contain.

Note: Different parts of a URL (scheme, authority, path, query, fragment) have different encoding rules. This tool uses standard URL encoding suitable for query parameters and form data.

Common Characters and Their Encodings

Character URL Encoded Description
Space %20 Space character
! %21 Exclamation mark
" %22 Quotation mark
# %23 Hash/Fragment identifier
% %25 Percent character
& %26 Ampersand/Query separator
+ %2B Plus sign
= %3D Equals sign/Query value separator
? %3F Question mark/Query indicator

Common Use Cases

Examples

Example 1: Query Parameter

Original: Hello World!

Encoded: Hello%20World%21

Example 2: Email Address

Original: [email protected]

Encoded: user%40example.com

Example 3: Complex Query

Original: search=JavaScript & Node.js

Encoded: search%3DJavaScript%20%26%20Node.js

References and Further Reading