How to Base64 encode and decode in Node.js Here is how you encodetext to base64 in Node.js: var b = new Buffer('JavaScript'); var s = b.toString('base64'); // SmF2YVNjcmlwdA== And here is how you dec. If you are decoding a binary file, use the 'DECODE AND DOWNLOAD' button. The decoder will