Free online URL encoder & decoder. Instantly encode or decode URL components.
Paste text in the input box and click URL Encode to convert special characters to percent-encoded form. Click URL Decode to reverse it. This tool uses JavaScript's encodeURIComponent(), which encodes all characters except A–Z a–z 0–9 - _ . ! ~ * ' ( ).
URL encoding, formally called percent encoding (RFC 3986), replaces unsafe or reserved characters in a URL with a % sign followed by two hexadecimal digits representing the character's UTF-8 byte value. For example, a space becomes %20, / becomes %2F, and & becomes %26.
This ensures that a URL is a valid ASCII string that can be safely transmitted over HTTP and interpreted correctly by any web server or browser.
A–Z a–z 0–9 - _ . ! ~ * ' ( ). Use this for encoding individual query parameter values. This is what this tool uses.: / ? # [ ] @ ! $ & ' ( ) * + , ; =) unencoded, because they have structural meaning in a URL.Space → %20 ! → %21 " → %22 # → %23
$ → %24 % → %25 & → %26 ' → %27
( → %28 ) → %29 * → %2A + → %2B
, → %2C / → %2F : → %3A ; → %3B
= → %3D ? → %3F @ → %40 [ → %5B
] → %5D { → %7B | → %7C } → %7D
// Encode a query parameter value
const q = encodeURIComponent('hello world & more');
// "hello%20world%20%26%20more"
// Build a full URL safely
const url = 'https://example.com/search?q=' + encodeURIComponent(query);
// Decode
const decoded = decodeURIComponent('hello%20world'); // "hello world"
from urllib.parse import quote, urlencode
# Encode a single value
encoded = quote('hello world & more') # 'hello%20world%20%26%20more'
# Encode a dict of query parameters
params = urlencode({'q': 'hello world', 'lang': 'en'})
# 'q=hello+world&lang=en' (note: urlencode uses + for spaces)
%20 is the standard percent-encoding for a space and is valid everywhere in a URL. + represents a space only in the application/x-www-form-urlencoded format used in HTML form submissions. When in doubt, use %20 — it is unambiguous everywhere.encodeURIComponent), not the entire URL. Encoding the entire URL would also encode the structural ://, /, and ? characters, breaking the URL.A–Z a–z, digits 0–9, and the four special characters - _ . ~.hello%20world) is encoded again, turning %20 into %2520. The server then receives a literal %20 instead of a space. Always check whether input is already encoded before encoding it.