javascript algorithm for base64 encoding code example Example: javascript base64 decode var decodedString = atob(encodedString);