public static void Main()
string base64Encoded = "NjAwMTIzNA==";
byte[] data = System.Convert.FromBase64String(base64Encoded);
base64Decoded = System.Text.ASCIIEncoding.ASCII.GetString(data);
Console.WriteLine(base64Decoded);
public static string Base64Decode(string base64EncodedData)
var base64EncodedBytes = System.Convert.FromBase64String(base64EncodedData);
return System.Text.Encoding.UTF8.GetString(base64EncodedBytes);
public static string Base64Encode(string plainText)