How to use the URL Encoder
Encode a URL or text in three steps:
1
Paste your URL or text
Paste any text, URL, or string containing special characters into the input area.
2
Choose an encoding mode
Select encodeURIComponent (for individual values), encodeURI (for full URLs preserving structure), or Strict RFC 3986 (also encodes ! ' ( ) *). The toolbar shows a plain-English description of each mode.
3
Copy the encoded output
The percent-encoded output appears instantly. Copy or download. The footer shows how many %XX sequences were created.
When to use this tool
Use URL encoding to safely embed special characters in URLs and HTTP requests:
- →Encoding query parameter values that contain spaces, ampersands, or Unicode characters before appending them to a URL
- →Preparing user-generated search terms for inclusion in a URL query string without breaking the URL structure
- →Encoding file paths or resource identifiers that contain non-ASCII characters for use in HTTP requests
- →Encoding email addresses, special symbols, or Unicode text for safe use in URL fragments or hash parameters
- →Preparing data to embed in a URL for a redirect, OAuth callback, or deep link parameter
- →Encoding individual form field values before manually constructing an application/x-www-form-urlencoded request body
Frequently asked questions
Q:What is the difference between encodeURIComponent and encodeURI?
encodeURIComponent encodes everything except letters, digits, and the characters - _ . ! ~ * ' ( ). This makes it safe for encoding individual query parameter values where characters like / : ? & = # must be encoded. encodeURI encodes everything except those same characters plus the URL-structure characters : / ? # [ ] @ ! $ & ' ( ) * + , ; = — so the URL's structural meaning is preserved. Use encodeURIComponent for values; use encodeURI for complete URLs.
Q:Why does a space become %20 in URLs?
The space character (ASCII 32) is not allowed in URLs per RFC 3986 because it is used as a delimiter in many contexts. It is percent-encoded as %20, where 20 is the hexadecimal value of 32. In HTML form submissions using the application/x-www-form-urlencoded format, spaces are alternatively encoded as + (plus signs). The URL Decoder tool's 'Form-encoded' mode handles both %20 and + representations.
Q:What is Strict RFC 3986 mode?
RFC 3986 defines a stricter set of unreserved characters that should not be encoded: A–Z, a–z, 0–9, -, _, ., ~. The JavaScript encodeURIComponent function also leaves ! ' ( ) * unencoded, which technically violates strict RFC 3986. Strict mode additionally encodes those five characters, producing fully RFC 3986-compliant output. Use it when interacting with APIs or systems that strictly follow RFC 3986 and reject those characters unencoded in query values.
Q:Are Unicode and emoji characters handled correctly?
Yes — Unicode characters are first converted to their UTF-8 byte sequences, then each byte is percent-encoded. For example, the emoji 🎉 (U+1F389) is encoded as %F0%9F%8E%89 — its four UTF-8 bytes in hexadecimal. Accented characters like é (U+00E9) become %C3%A9 — its two UTF-8 bytes. This is the correct and universal approach to encoding non-ASCII characters in URLs.
Q:Should I encode the entire URL or just the values?
Generally, encode only the dynamic values — the parts that contain user input or data. The structural characters of the URL (the protocol, domain, path separators, and query string delimiters like ?, &, =) should not be encoded, or the URL will be malformed. Use encodeURIComponent on each key and value separately before building the query string, rather than encoding the assembled URL. The URL Builder tool constructs this correctly automatically.
Q:What characters are safe in a URL and don't need encoding?
RFC 3986 defines the unreserved characters that never need encoding: uppercase and lowercase letters (A–Z, a–z), digits (0–9), hyphen (-), underscore (_), period (.), and tilde (~). Reserved characters (: / ? # [ ] @ ! $ & ' ( ) * + , ; =) have structural meaning in URLs and must be encoded if they appear in a data context. All other characters, including spaces and Unicode, must always be percent-encoded.