Base64 encoding and decoding tool

A small tool for Base64 encoding end decoding.

The tool

This tool uses the two functions atob and btoa.



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 = window.btoa(decoded.value);
}
function decodeString() {
    decoded.value = window.atob(encoded.value);
}
</script>
Next Previous