Encode, decode, validate, parse, build, and normalize URLs and Query Strings with 8 specialized tools.
How to build robust web addresses, encode reserved characters, and parse query parameters.
A Uniform Resource Identifier follows the grammar: scheme:[//authority]path[?query][#fragment]. Any character outside the unreserved ASCII set (A-Z, a-z, 0-9, "-", "_", ".", "~") or acting as a reserved delimiter must be escaped via percent-encoding as %XX using its two-digit UTF-8 hexadecimal value (e.g. space becomes %20).
encodeURI is intended for complete working addresses, preserving syntactic delimiters (":", "/", "?", "&", "#"). Conversely, encodeURIComponent aggressively escapes all reserved punctuation; it must be applied specifically to individual query parameter keys or values so that internal symbols like "&" or "=" do not fragment the query string.
Legacy regexes for parsing query strings introduce edge-case bugs with encoded entities or repeated keys. The modern web standard WHATWG URL and URLSearchParams APIs handle bidirectional normalization, multi-value keys (?tag=a&tag=b), and clean UTF-8 parameter serialization.
RFC 3986 defines "%20" as the standard URI encoding for space. The "+" symbol is a legacy encoding convention for query strings originating from HTML forms (application/x-www-form-urlencoded).
No. All parsing, validation, and encoding logic runs 100% locally inside your browser thread.
Encode the target URL with encodeURIComponent so its protocol colons, slashes, and question marks do not collide with the host address parser.