Base64 Encoding Tool - Encode Your Files Online for Free!

Our Base64 encoding tool is a free, online tool that allows you to easily convert your files to Base64 format.

Base64 encoding is a popular way to represent binary data in ASCII text format, which makes it easier to transmit over the internet or store in a database.

Additionally, we provide JavaScript code that you can copy and use in your own projects. This code makes it easy to integrate Base64 encoding into your website or application.

Our tool is fast, secure, and works with a wide variety of file types, including images, documents, and videos. Try it out today and see how easy it is to encode your files to Base64!

Instructions

  1. Select the file you want to encode by clicking the "Choose File" button.
  2. Once selected the file will automatically encode.
  3. Copy the generated Base64 string to your clipboard by clicking the "Copy" button.
  4. Paste the Base64 string into your website or application where needed.

How To Code

Feel free to copy the code for your website

const inputElement = document.getElementById("image-input"); inputElement.addEventListener("change", e => { const fileList = e.target.files; const reader = new FileReader(); reader.onload = event => { var binary = ''; var bytes = new Uint8Array(event.target.result); var len = bytes.byteLength; for (var i = 0; i < len; i++) { binary += String.fromCharCode(bytes[i]); } document.getElementById("gen-output").innerText = btoa(binary); } reader.readAsArrayBuffer(fileList[0]); }, false);