A small online tool to URL encode and decode strings.
This tool uses the two functions encodeURIComponent
and
decodeURIComponent
.
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>