Tools
URL Encoder and Decoder
Encode special characters in URLs to the %XX format, or decode percent-encoded strings back to readable text. Essential when working with APIs and query strings.
Why URLs don't accept just any character
A URL is made of parts with well-defined roles: protocol, domain, path, query string and fragment. Each part uses specific characters as delimiters: /, ?, &, # and others. When user data contains those same characters, they must be escaped so the server reads the URL correctly.
Percent-encoding, defined by RFC 3986, solves this by converting any problematic character into its hexadecimal representation preceded by %. This guarantees that an & inside a parameter value is not mistaken for a parameter separator, and that accents and Unicode characters work on any server.
Reserved and unreserved characters in RFC 3986
RFC 3986 splits URL characters into two categories. Unreserved characters (letters, digits, -, _, ., ~) can appear in URLs without encoding. Reserved characters (: / ? # [ ] @ ! $ & ' ( ) * + , ; =) have special meaning in the URL structure and should only be used unencoded when serving that structural role. All other characters, including accented letters, must be percent-encoded.
In practice, when building a query string with dynamic parameters, always use encodeURIComponent for each value. This ensures any special character in the value is escaped correctly without affecting the structure of the surrounding URL.
encodeURI vs encodeURIComponent: which one to use?
encodeURI is suitable when you have a complete URL and only want to make sure non-ASCII characters are encoded while preserving the structure. encodeURIComponent is the right choice for encoding individual values, especially query string parameter values, because it also encodes structural delimiters such as &, = and ?.
A practical example: when building a search URL for the term "coffee & cake", the value must be encoded with encodeURIComponent before being concatenated to the base URL. The result is search=coffee%20%26%20cake, which ensures the server receives the exact term without ambiguity.
Common problems with unencoded URLs
Share links that break when copied, UTM campaign parameters with wrong values, forms that send corrupted data to external APIs and mysterious 404 errors are often caused by missing encoding. Another common case is redirect links: the destination URL needs to be encoded so it does not confuse the server with the redirector's base URL.
Analytics tools such as Google Analytics and ad platforms are particularly sensitive to incorrect encoding in UTM parameters. An unencoded & in utm_content can cause the following parameters not to be tracked.
Decoding URLs in logs and analytics
Web server access logs store URLs exactly as they were received, usually percent-encoded. When analyzing those logs to understand user behavior, reading queries like search%3Dproduct%26category%3Delectronics%20%26%20gadgets is impractical without decoding. Use this tool to turn log URLs into readable text quickly.
In analytics platforms such as Google Search Console, the search URLs that reach your site also show up encoded. Decoding them is essential to identify the actual keywords people use to find your content.
Frequently asked questions
What is URL encoding?
URL encoding (also called percent-encoding) is the process of replacing characters that are not allowed or have special meaning in URLs with a safe representation: the % sign followed by two hexadecimal digits representing the character's byte in UTF-8. For example, a space becomes %20, the & symbol becomes %26 and the letter é becomes %C3%A9.
What is the difference between encodeURI and encodeURIComponent?
encodeURI encodes a complete URL, preserving the characters that are part of the URL structure such as /, ?, # and &. encodeURIComponent encodes an isolated component, such as a parameter value, and also converts those structural characters. Use encodeURIComponent for query string values; use encodeURI only when encoding an entire URL whose structure is already in place.
Why does a space become %20 and not simply a +?
There are two conventions. RFC 3986 percent-encoding converts a space to %20. The application/x-www-form-urlencoded format (used by HTML forms) converts a space to +. Both are valid in different contexts. Modern REST APIs usually expect %20, while traditional HTML forms use +. To avoid ambiguity in APIs, always prefer %20.
When can a URL break without encoding?
A URL breaks without encoding when it contains characters with reserved meaning in the wrong context. For example, an & in a parameter value would be read as a parameter separator, and a # would be read as the start of a fragment. Non-ASCII characters such as accented letters can be misread by servers or libraries that do not support Unicode in URLs.
How do I decode URLs in server logs?
Web server logs such as Nginx and Apache record URLs with percent-encoding. To make those logs readable, paste the encoded URL into this tool and get the decoded version. This is especially useful for debugging search parameters, tracking marketing campaigns and analyzing 404 errors caused by malformed URLs.
Do accented characters need encoding in URLs?
Technically, yes. Characters such as é, ñ, ü and others outside ASCII need to be encoded in URLs for maximum compatibility. RFC 3987 introduced IRIs (Internationalized Resource Identifiers), which allow Unicode directly, and modern browsers convert automatically. Still, when building URLs programmatically in APIs or scripts, always encode explicitly to ensure universal compatibility.

