🌐 URL Encoder & Decoder

Encode special characters in URLs or decode percent-encoded URL strings instantly. Full URL or component encoding — free, no login, 100% browser-based.

FreeNo LoginBrowser-BasedPrivate

What is URL Encoding?

URL encoding — formally called percent-encoding, defined in RFC 3986 — is a mechanism for converting characters that have special meaning in URLs into a safe format for transmission over the internet. URLs can only contain a limited set of ASCII characters. Characters outside this set, or characters that carry structural meaning in URLs (like ?, &, =), must be encoded before being placed inside a URL.

Encoding works by replacing each restricted character with a % sign followed by its two-digit hexadecimal ASCII code. A space becomes %20, an ampersand becomes %26, and a hash becomes %23. This transformation is completely reversible — decoding converts %20 back to a space.

Every browser, web server, and HTTP library performs URL encoding and decoding automatically in most cases. However, developers need to encode manually when constructing URLs programmatically — especially query string parameters — to prevent parsing errors and security vulnerabilities.

Full URL Encode vs Component Encode — Which to Use

Mode JavaScript Function What It Preserves Use When
Full URLencodeURI(): / ? # & = @ (URL structure)Encoding a complete URL
ComponentencodeURIComponent()- _ . ! ~ * ' ( ) onlyEncoding a query parameter value

💡 Rule of thumb: Always use Component Encode when encoding individual query parameter values. If you have a URL like https://example.com/search?q=hello world&lang=en, encode each value separately: q=hello%20world&lang=en.

Common URL Encoding Reference Table

Character Encoded Meaning in URLs
Space%20Not allowed unencoded
&%26Query parameter separator
=%3DKey=value separator
#%23Fragment identifier
+%2BLegacy form space (avoid)
/%2FPath separator
?%3FQuery string start
%%25Encoding prefix — must encode

Frequently Asked Questions

What is URL encoding?

URL encoding (percent-encoding, RFC 3986) converts special characters into a safe format for URL transmission by replacing each character with a % sign followed by its two-digit hex ASCII code. A space becomes %20, & becomes %26. Essential for building URLs programmatically.

What is the difference between Full URL and Component encoding?

Full URL mode (encodeURI) preserves structural characters like :/?#&=@ so a complete URL stays valid. Component mode (encodeURIComponent) encodes everything including those characters — use it for individual query parameter values.

Why do spaces sometimes appear as + instead of %20?

Both represent spaces, but from different standards. %20 is the RFC 3986 standard for modern URLs. + for spaces comes from the older HTML form encoding standard. Most servers accept both. Use %20 in new code.

Which characters need to be URL encoded?

Must encode in query parameters: space, &, =, +, #, %, /, ?, @, :. Safe without encoding: letters A–Z and a–z, digits 0–9, and the four symbols - _ . ~ (hyphen, underscore, period, tilde).

When do I need to URL encode in practice?

Five common scenarios: (1) Building API query strings programmatically. (2) Passing a full URL as a query parameter to another URL. (3) Submitting forms with special characters. (4) Constructing redirect URLs that include other URLs as parameters. (5) Debugging malformed URLs received from external APIs.

Related Tools