UUID & GUID Generator
Free online UUID and GUID generator: generate random RFC 4122 version 4 UUIDs instantly in bulk or single. 100% private in-browser with zero tracking.
Free online URL encoder and decoder: encode and decode URLs and URI query parameters with UTF-8 percent-encoding. 100% private in-browser with zero uploads.
Uniform Resource Identifiers (URIs) and Uniform Resource Locators (URLs) are the universal addressing system of the internet. Defined by the Internet Engineering Task Force (IETF) in RFC 3986, a URL must adhere to a tightly constrained character set to ensure that web browsers, reverse proxies (Nginx, Cloudflare), web servers, and DNS routers parse addresses deterministically across every computing platform.
However, real-world web applications routinely transmit non-ASCII data, such as international alphabets, emojis, search terms containing ampersands (&), and nested callback links. Percent-encoding (often referred to as URL encoding) provides the standardized mechanism to represent arbitrary UTF-8 characters and reserved delimiters safely within URL query strings, path segments, and HTTP headers.
Percent-encoding translates any character outside the permitted set into a three-character sequence: a literal percent sign (%) followed by two hexadecimal digits representing the byte's numerical value (from 00 to FF).
0x20, encoding into %20. Similarly, the question mark (?) has hex value 3F, encoding into %3F.é consists of two UTF-8 bytes (0xC3 0xA9), encoding into %C3%A9. The rocket emoji (🚀) comprises four UTF-8 bytes (0xF0 0x9F 0x9A 0x80), producing %F0%9F%9A%80.RFC 3986 divides all possible URL characters into two distinct categories:
Characters that never have syntactic delimiter roles: A–Z, a–z, 0–9, hyphen (-), underscore (_), period (.), and tilde (~). These characters must never be percent-encoded by standard encoders.
Characters that serve as structural boundaries: : / ? # [ ] @ ! $ & ' ( ) * + , ; =. When used as literal user data rather than URL delimiters, they must be percent-encoded to prevent syntax ambiguity.
A universal pitfall in frontend web development is using the wrong JavaScript encoding function. While their names appear similar, they serve entirely different architectural purposes:
| Feature | encodeURI() | encodeURIComponent() |
|---|---|---|
| Primary Purpose | Encodes a complete, existing URL link. | Encodes a single query parameter key or value. |
| Preserves URL Delimiters | Yes (leaves https://, /, ?, &, # unencoded) | No (encodes / into %2F, & into %26, etc.) |
| Typical Use Case | Fixing a broken full URL that contains raw spaces. | Sanitizing user search terms, redirect URIs, or webhook payloads. |
Rule of Thumb: If you are building a URL by concatenating query strings (e.g., "?search=" + val), you must always pass val through encodeURIComponent(). If you pass an entire URL into encodeURIComponent(), the browser will not recognize http%3A%2F%2F as a protocol.
Engineers frequently wonder why some URLs encode spaces as %20 while others use +:
%20): In the official URI standard, the plus character (+) is a reserved sub-delimiter, not a space. Therefore, in URL path segments (e.g., /blog/my%20first%20post), a space must strictly be encoded as %20. Using + in a path segment represents a literal plus sign.+): When HTML forms submit data via GET or POST using the media type application/x-www-form-urlencoded, spaces are converted into + characters for legacy readability (e.g., ?q=hello+world).Toolhast provides a simple toggle allowing you to switch between standard %20 and form-encoded + based on your backend framework's expectations.
Improper handling of percent-encoding is a leading cause of severe web application security vulnerabilities:
<script>, the attacker can submit %253Cscript%253E. The first decode yields %3Cscript%3E (passing the filter), and the secondary decode executes the unescaped script tag.redirect_uri parameters. If the redirect URL is unencoded or improperly validated, attackers can inject malicious destinations to steal authorization codes.&) inside parameter values allows attackers to inject unexpected query keys, altering application logic.Zero-Upload Privacy: Toolhast executes all encoding, decoding, and URL inspection 100% locally inside your web browser. Sensitive API tokens, OAuth authorization codes, and internal query strings are never transmitted across the network or stored on external servers.
Select your mode: URL Encoder & Decoder for bulk text conversion, or Query Parameter Inspector to parse full web links.
Type or paste your raw text, query parameter, or full URL into the input editor, or click 'Sample' to load a demo.
Choose your encoding scope (Component Mode for values vs Full URL Mode for links), and toggle space as '+' if needed.
Click 'Copy' to copy the encoded or decoded output, or inspect and edit individual query parameters in the interactive builder.
Encoded via Component Mode, ensuring '&' and '?' do not break the surrounding URL query structure.
The redirect parameter value is properly percent-encoded while preserving the outer authentication URL structure.
The `encodeURI` function encodes full web addresses while preserving structural URI delimiters like slashes, colons, question marks, and ampersands (`https://`, `?`, `&`). In contrast, `encodeURIComponent` aggressively encodes all characters except basic alphanumeric and unreserved symbols, making it mandatory for query parameter values so delimiters are not misinterpreted by web servers.
Strict RFC 3986 URI standards require spaces to be percent-encoded as `%20`. However, the HTML form specification (`application/x-www-form-urlencoded`) standardizes encoding spaces as `+` inside URL query strings. For modern REST APIs and path segments, prefer `%20`; for legacy web form submissions and query parameters, `+` is widely accepted.
RFC 3986 designates characters with syntactic meaning as reserved: colons, slashes, question marks, hashes, brackets, and ampersands (`: / ? # [ ] @ ! $ & ' ( ) * + , ; =`). If these characters represent raw user data rather than URL structure, they must be percent-encoded to prevent breaking the URI parser.
A `URIError: URI malformed` occurs when a percent sign (`%`) is not followed by two valid hexadecimal digits (`0–9`, `A–F`), or when a multi-byte UTF-8 character sequence is truncated or invalid. Toolhast catches these exceptions automatically and alerts you to the exact malformed sequence so you can fix it.
Double encoding occurs when an already percent-encoded string is accidentally encoded a second time, turning `%20` into `%2520`. In web security, attackers use double encoding to bypass web application firewall (WAF) filters, potentially triggering directory traversal or cross-site scripting (XSS) if the backend server decodes the parameter twice unexpectedly.
No. Toolhast performs 100% of URL encoding, decoding, query parameter parsing, and link reconstruction directly inside your web browser via client-side JavaScript. No URL strings, search queries, OAuth authorization codes, bearer tokens, or tracking parameters are ever sent across the network or logged on external servers, guaranteeing total confidentiality.
Free online UUID and GUID generator: generate random RFC 4122 version 4 UUIDs instantly in bulk or single. 100% private in-browser with zero tracking.
Free online JSON formatter, validator, and minifier: beautify messy JSON, fix errors, and minify code instantly. 100% private in-browser with zero uploads.
Free online Base64 encoder and decoder: encode and decode text or files to Base64 with UTF-8 support. 100% private in-browser with zero server uploads.
Private: this tool runs in your browser. Nothing you type is uploaded.
Last updated