URL Encoder / Decoder

Percent-encode URLs or decode them back to readable form.

Open tool

Overview

Percent-encode a URL or a query-string value, or decode it back to readable form. Handles the difference between encoding for the path component (/ preserved), the query string (& and = preserved), and a raw value within a parameter (everything reserved is escaped).

It's for developers building requests by hand, crafting redirect URLs that include other URLs as parameters, or debugging an API that's choking on + vs %20. Reach for it when constructing OAuth redirect URIs, signing webhook URLs, or piecing together a deep link.

How it works

URL encoding (percent-encoding) is defined in RFC 3986. Reserved characters (!*'();:@&=+$,/?#[]) must be encoded when they appear in a context where they'd be parsed as delimiters. Unreserved characters (A-Z a-z 0-9 - _ . ~) are never encoded.

The encoder offers three modes: encodeURI (path-safe, preserves :/?#[]@!$&'()*+,;=), encodeURIComponent (escapes everything reserved - use for query values), and a strict variant that also escapes the typically-unreserved tilde. The decoder is permissive: it accepts both %20 and + for spaces (the latter being the historical query-string convention).

Examples

  • Encode a path segment:
    user name -> user%20name
    
  • Encode a query value (encodeURIComponent style):
    https://example.com  ->  https%3A%2F%2Fexample.com
    
  • Decode:
    search?q=hello%20world  ->  search?q=hello world
    
  • Plus-as-space (query string convention):
    q=hello+world  ->  q=hello world  (decoded as space)
    

FAQ

encodeURI vs encodeURIComponent?

encodeURI is for whole URLs (preserves delimiters). encodeURIComponent is for values you're embedding inside a URL (escapes everything reserved). For 95% of cases you want encodeURIComponent.

Should I use + or %20 for spaces?

In the query string both are accepted by servers, but %20 is the unambiguous choice. + only means space inside application/x-www-form-urlencoded bodies and query strings - elsewhere in the URL it's literal.

Why is my emoji encoded to multiple %xx?

Non-ASCII characters are UTF-8 encoded first, then each byte is percent-encoded. A single Unicode code point can become 6 or 9 percent-encoded characters.

Are letters and digits ever encoded?

Per RFC 3986 they're never reserved. Some legacy systems over-encode them; the strict mode handles those if you need bytewise equivalence.

Try URL Encoder / Decoder

An unhandled error has occurred. Reload ×