URL Percent-Encoder & Parameter Inspector
Percent-encode and decode URLs adhering to RFC 3986. Switch between encodeURI and encodeURIComponent, inspect query parameters, and handle UTF-8 characters.
URL Percent-Encoder & Parameter Inspector
Detected Query Parameters (3)
About
Our URL Percent-Encoder & Parameter Inspector provides client-side encoding, decoding, and query string parameter extraction adhering strictly to RFC 3986 (Uniform Resource Identifier: Generic Syntax) and WHATWG URL standards. Every conversion executes 100% locally in your browser memory with zero server telemetry or network logging.
RFC 3986 URL Encoding Principles & Character Taxonomy
A Uniform Resource Identifier (URI) is mathematically constrained to a defined repertoire of ASCII characters. Any character outside this permitted range—including spaces, international CJK ideographs, accented characters, and emojis—must be converted into percent-encoded octets (%XX representing hex values).
RFC 3986 strictly classifies ASCII characters into two functional tiers:
- Unreserved Characters (Never Encoded): Digits (
0-9), Letters (A-Z, a-z), Hyphen (-), Underscore (_), Period (.), Tilde (~). - Reserved Characters (Delimiters):
:,/,?,#,[,],@,!,$,&,',(,),*,+,,,;,=.
Comparative Analysis: encodeURI vs encodeURIComponent vs escape
| Feature / Standard | encodeURI (Full URL Mode) | encodeURIComponent (Component Mode) | Legacy escape() (Deprecated) |
|---|---|---|---|
| Primary Purpose | Sanitizing a complete URL without breaking structural separators | Encoding individual query values, path segments, or nested callback URLs | Obsolete 1990s JS function (Do NOT use) |
Encodes Reserved Delimiters (:/?&=#) |
NO (Preserves structure) | YES (Encodes : as %3A, / as %2F, & as %26) |
Partial / Inconsistent |
| Encodes ASCII Spaces | Encodes as %20 |
Encodes as %20 |
Encodes as %20 |
| UTF-8 Multi-byte Multilingual Support | Fully compliant with RFC 3986 | Fully compliant with RFC 3986 | Broken: Outputs non-standard %uXXXX |
| Best Architectural Use Case | Cleaning up user-entered links | Setting OAuth redirect_uri, query params, webhooks | Strictly forbidden in modern ECMAScript |
The Classic Space Dilemma: %20 vs +
- RFC 3986 Standard URI Path & Query: A space MUST be percent-encoded as
%20. Universal standard for modern RESTful APIs. - HTML Form POST / application/x-www-form-urlencoded: In legacy HTML forms, spaces are encoded as plus signs (
+). When decoding query parameters in backend routers,+must be converted back to spaces.
Developer Implementation Code Snippets
Node.js & TypeScript
export function buildTrackingUrl(baseUrl: string, params: Record<string, string>): string {
const url = new URL(baseUrl);
for (const [key, value] of Object.entries(params)) {
url.searchParams.set(key, value);
}
return url.toString();
}
Python 3
from urllib.parse import quote, unquote, urlencode
encoded = quote("hello 世界 & friends", safe="")
decoded = unquote(encoded)
Go
package main
import "net/url"
func main() {
encoded := url.QueryEscape("https://x114.org/tools?q=hello world")
path := url.PathEscape("user profile/photos")
}