URL Decode Online
URL decode
URL decoding is the process of converting URL-encoded strings back to their original form. URL encoding is used to represent special characters and non-ASCII characters in a safe format for URLs, and URL decoding reverses this process to retrieve the original string.
URL-encoded strings use percent encoding, where special characters are represented by a percent sign followed by two hexadecimal digits that represent the character's ASCII code.
For example, consider the URL-encoded string:
my%20search%20query
In this string, %20 represents a space character. URL decoding would convert this string back to:
my search query
In JavaScript, you can use the decodeURIComponent() function to URL decode a string:
const decodedString = decodeURIComponent("my%20search%20query"); console.log(decodedString); // Output: "my search query"
In PHP, you can use the urldecode() function to URL decode a string:
$decodedString = urldecode("my%20search%20query"); echo $decodedString; // Output: "my search query"
URL decoding is important when working with data passed through URLs, as it allows you to retrieve the original data and use it in your web applications without issues related to special characters or non-ASCII characters.