URL encode and decode tool

A small online tool to URL encode and decode strings.

The tool

This tool uses the two functions encodeURIComponent and decodeURIComponent.



JavaScript

Here the small JavaScript and unstyled HTML code behind it.

<textarea id="decoded"></textarea>
<button onclick="encodeString();">encode</button>
<textarea id="encoded"></textarea>
<button onclick="decodeString();">decode</button>
<script>
var decoded = document.getElementById("decoded");
var encoded = document.getElementById("encoded");
function encodeString() {
    encoded.value = encodeURIComponent(decoded.value);
}
function decodeString() {
    decoded.value = decodeURIComponent(encoded.value);
}
</script>
Next Previous