URL Encoder, Decoder & Validator
Free online URL encoder, decoder, parser, and query string builder with RFC 3986 compliance
Loading...
Free online URL encoder, decoder, parser, and query string builder with RFC 3986 compliance
Paste a URL to see its components
?, &, =, and # have special meaning in URL syntax, so when they appear as data (e.g., inside query parameter values) they must be encoded as %HH where HH is the hexadecimal byte value. For example, a space becomes %20 and an ampersand becomes %26. Without percent-encoding, parsers cannot distinguish between structural delimiters and literal data.https://example.com/path). A URN (Uniform Resource Name) is a URI that identifies a resource by name within a namespace without implying how to locate it (e.g., urn:isbn:0451450523). In practice, every URL is a URI, but not every URI is a URL. Modern web development almost exclusively deals with URLs.A-Z a-z 0-9 - . _ ~. All other characters must be percent-encoded when used as data. The reserved characters with structural meaning include : / ? # [ ] @ ! $ & ' ( ) * + , ; =. These only need encoding when they appear outside their designated role. Non-ASCII characters (e.g., Unicode) must first be encoded as UTF-8 bytes, then each byte is percent-encoded individually. For example, the euro sign (€) becomes %E2%82%AC.? character in a URL and consists of key-value pairs separated by & (or sometimes ;). To parse correctly: split on &, then split each pair on the first = (values may contain =), and finally percent-decode both the key and value. In JavaScript, the URLSearchParams API handles this automatically, including support for duplicate keys. Be aware that + in query strings represents a space (a legacy convention from HTML form encoding), which differs from path segments where only %20 represents a space.encodeURI() encodes a complete URI and therefore preserves characters that have structural meaning in URLs: : / ? # [ ] @ ! $ & ' ( ) * + , ; =. Use it when you have a full URL string and want to escape only illegal characters. encodeURIComponent() encodes a single URI component (like a query parameter value) and escapes all reserved characters including / ? & =. Using the wrong function is a common source of bugs: encodeURI on a parameter value leaves & and = unescaped, breaking query string parsing. Always use encodeURIComponent for individual values.