URL Encoder & Decoder
Percent-encode text for safe use in URLs, or decode an encoded string back to readable text.
How it works
Encode component (encodeURIComponent) escapes everything except letters, digits and - _ . ! ~ * ' ( ). Use it for a single query value or path segment. Encode full URL (encodeURI) keeps the URL structure characters : / ? # & = intact and only escapes the rest.
Spaces become %20 and non-ASCII characters are encoded as UTF-8 bytes, for example รฉ becomes %C3%A9.
Frequently asked questions
What is the difference between encodeURI and encodeURIComponent?
encodeURI is for whole URLs and leaves characters like / ? & = alone. encodeURIComponent is for individual values and escapes them, so a value containing & does not break the query string.
Why is my decoded text garbled?
The text may have been encoded in a legacy charset instead of UTF-8, or it may have been double-encoded (%2520 instead of %20). Try decoding twice.
Is + a space in a URL?
Only in application/x-www-form-urlencoded query strings. In a path, + is a literal plus; %20 is always a space.