Categories
JavaScript Answers

How to convert base64 string to ArrayBuffer with JavaScript?

Spread the love

To convert base64 string to ArrayBuffer with JavaScript, we use the Buffer.from method.

For instance, we write

const myBuffer = Buffer.from(someBase64String, "base64");

to call Buffer.from with the someBase64String base64 string and 'base64' to convert the base 64 string to a buffer.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published.