URL Encoder/Decoder
Encode and decode URLs and query parameters
Frequently Asked Questions
What is URL encoding and why is it necessary?
URL encoding (also called percent encoding) converts special characters into a format that can be safely transmitted in a URL. Characters like spaces, ampersands, and question marks have special meanings in URLs, so they must be encoded as percent-sign followed by their hexadecimal value (e.g., space becomes %20) to avoid breaking the URL structure.
What is the difference between Component encoding and Full URL encoding?
Component encoding (encodeURIComponent) encodes all special characters including slashes, colons, and question marks, making it ideal for query parameter values. Full URL encoding (encodeURI) preserves URL-structural characters like ://?#@ so the URL remains navigable. Use Component mode for individual values and Full URL mode for complete URLs.
Why do spaces sometimes appear as %20 and sometimes as a plus sign?
The %20 encoding is the standard URL percent-encoding for spaces and works everywhere. The plus sign (+) for spaces is specific to the application/x-www-form-urlencoded format used in HTML form submissions. Modern APIs and URLs generally use %20, while form data in POST requests traditionally uses the plus sign.
Which characters need to be URL-encoded?
Any character outside the unreserved set (A-Z, a-z, 0-9, hyphen, underscore, period, tilde) should be encoded when used in URL components. Reserved characters like &, =, ?, /, and # must be encoded when they appear as data rather than as URL delimiters. Unicode characters and non-ASCII text always require encoding.
Can URL encoding handle non-English characters and emojis?
Yes, URL encoding fully supports Unicode text including non-English characters and emojis. The characters are first converted to their UTF-8 byte representation, then each byte is percent-encoded. For example, a single emoji may produce a sequence of 4-12 percent-encoded bytes.