URL Encode
Percent-encode text so it is safe to use in URLs and query strings. Encodes spaces and special characters.
Loading tool…
How to use the URL Encode
URLs can only contain certain characters. URL encoding replaces spaces and special characters with percent codes (for example a space becomes %20) so your data travels safely in a web address or query string.
- 1Type or paste the text to encode.
- 2Choose "encodeURIComponent" (full) or "encodeURI" (keeps URL structure).
- 3See the encoded result instantly.
- 4Copy it into your URL or query string.
Frequently asked questions
What is the difference between the two modes?
encodeURIComponent encodes everything including "/" and "?", ideal for a single value. encodeURI keeps the overall URL structure intact.
Why does a space become %20?
Spaces are not allowed in URLs, so they are replaced with their percent-encoded value %20 (or + in some forms).