Skip to content

Encode and Decode to Base64 in JavaScript

You can convert text to Base64 in JavaScript:

btoa("Hello world");
//Returns: "SGVsbG8gd29ybGQ="

You can also convert a Base64 string back to plain text:

atob("SGVsbG8gd29ybGQ=");
//Returns: "Hello World"

(source)

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.