URL Encode Example in PHP

    $url = "https://www.example.com?id=21&name=param";
    $encodedurl = urlencode($url);
    echo $encodedurl;

URL Encode Example in Javascript

    var uri = "https://www.example.com?id=21&name=param";
    var encoded = encodeURIComponent(uri);

URL Encode Example in C#

    var url = 'https://www.example.com?id=21&name=param';    
    var result = HttpUtility.UrlEncode(url);

How to URL Encode Online?

You can easily encode urls using this online tool. To encode just enter a valid HTTP url into the textbox provided and press encode button.


You can also check similar URL Decode tool.