Loading...
Encode and decode URLs with percent-encoding — instantly in your browser.
encodeURI() encodes a full URL but leaves reserved characters (: / ? # & =) intact. encodeURIComponent() encodes everything except letters, digits, and - _ . ~ — use it for query parameter values.
In URL query strings (application/x-www-form-urlencoded), spaces become +. In URL paths and other contexts (RFC 3986), spaces become %20. Both are valid in their respective contexts.
Search engines decode URLs for display but handle encoded URLs correctly. For readability, use human-readable URL slugs and only encode special characters when necessary.
Double encoding happens when an already-encoded string is encoded again (e.g., %20 becomes %2520). Decode until the output stops changing, then encode once.
Characters outside the "unreserved" set (A-Z, a-z, 0-9, -, _, ., ~) should be percent-encoded. Common examples: spaces (%20), ampersand (%26), equals (%3D), hash (%23), and non-ASCII characters like accented letters.