---
layout: default
---

Base64:<br>
<input type="text" id="base64">
<br>
ASCII:<br>
<input type="text" id="ascii">

<br><button type="button" id="base64toascii" onclick="base64toascii()">Convert Base64 to ASCII</button>
<br><button type="button" id="asciitobase64" onclick="asciitobase64()">Convert ASCII to Base64</button>

<script language="JavaScript">
  //btoa encodes
  function base64toascii() {
    var base64string = document.getElementById('base64').value;
    console.log(base64string);
    document.getElementById('ascii').value = atob(base64string);
  }

  function asciitobase64() {
    var asciistring = document.getElementById('ascii').value;
    console.log(asciistring);
    document.getElementById('base64').value = btoa(asciistring);
  }
</script>

---
layout: default
---

Base64:<br>
<textarea type="text" id="base64"></textarea>
<br>
ASCII:<br>
<textarea type="text" id="ascii"></textarea>

<br><button type="button" id="base64toascii" onclick="base64toascii()">Convert Base64 to ASCII</button>
<br><button type="button" id="asciitobase64" onclick="asciitobase64()">Convert ASCII to Base64</button>

<script language="JavaScript">
  //btoa encodes
  function base64toascii() {
    var base64string = document.getElementById('base64').value;
    document.getElementById('ascii').value = atob(base64string);
  }

  function asciitobase64() {
    var asciistring = document.getElementById('ascii').value;
    document.getElementById('base64').value = btoa(asciistring);
  }
</script>

Change to text box type
Change to text box type
