Online tool for encoding plain text to Base64 and decoding Base64-encoded characters to plain text. Conversion is done in the browser, no data is sent to the backend.

HTML
CSS
JavaScript
<div id="converter">
  <div id="textareas">
    <textarea id="input" placeholder="Input"></textarea>
    <textarea id="output" placeholder="Output"></textarea>
  </div>
  <div id="converter-buttons">
    <span>
      <button id="convert">Convert</button>
      <select id="conversion-type">
        <option value="plain">Plaintext to Base64</option>
        <option value="base64">Base64 to Plaintext</option>
      </select>
    </span>
    <button id="swap-values">Swap values</button>
  </div>
</div>
#converter {
  margin-top: 30px;
}

#textareas {
  display: flex;
  flex-direction: row;
}
#converter textarea {
  width: 50%;
  padding: 5px;
  min-height: 200px;
  font-size: 14px;
  color: #404040;
}
.applet-body {
  border: none !important;
}
#prefix label {
  font-weight: bold;
  margin-left: 7px;
  color: #404040;
}
#converter-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
}
#convert, #conversion-type, #swap-values {
  font-size: 15px;
  border-radius: 5px;
}
document.querySelector('#convert').onclick = function() {
  const inputMode = document.querySelector('#conversion-type').value;
  const input = document.querySelector('#input').value;
  if (!input) return;

  let output = '';

  if (inputMode === 'plain') {
    output = btoa(input);
  } else {
    output = atob(input);
  }

  document.querySelector('#output').value = output;
}

document.querySelector('#swap-values').onclick = function() {
  const input = document.querySelector('#input').value;
  const output = document.querySelector('#output').value;
  document.querySelector('#input').value = output;
  document.querySelector('#output').value = input;
}