URL Encoder / Decoder
Encode and decode URLs instantly.
Input
Encode URL (encodeURI)
Keeps reserved characters ? & = # meaningful
Decode URL (decodeURI)
Restores percent-encoded characters
Encode Component (encodeURIComponent)
Encodes everything, safe for query values
Decode Component (decodeURIComponent)
Restores a fully encoded component
URL vs component encoding
encodeURI() keeps the characters that are structurally meaningful in a URL
(? & = # / : ; , @ $ +) and encodes the rest. encodeURIComponent()
encodes those too, which is what you want for query-string values and path segments. Both
percent-encode non-ASCII text as UTF-8, so emoji and CJK scripts work correctly.
Frequently asked questions
What is the difference between URL and component encoding?
encodeURI() keeps reserved characters such as ? & = # meaningful in a URL. encodeURIComponent() encodes them too, which is correct for query values and path segments.
Does it handle Unicode and emoji?
Yes. All characters above ASCII are percent-encoded to their UTF-8 byte sequences, so emoji, Chinese, Arabic and other scripts work correctly.
Why does my URL show %20?
%20 is the percent-encoding of a space. The decoder turns it back into a literal space when you press decode.