Base64 is a binary-to-text encoding scheme that converts arbitrary binary data (like images, files, or any sequence of bytes) into a safe, printable ASCII string using a 64-character alphabet. Browsers use it in JavaScript to embed binary data directly in code or HTML or for transmitting binary data as text.
This page benchmarks the Uint8Array.toBase64() and Uint8Array.fromBase64() methods that landed in browsers in 2025.
These new functions are fast, simple and safe.
const b64 = Base64.toBase64(bytes); // string const recovered = Base64.fromBase64(b64); // Uint8Array, matches original 'bytes'
To see how fast they are in your browser, hit the button.