How to decode a base64 string in C#?

Here’s a sample code snippet demonstrating how you can easily decode a base64 encoded string in C#.

How to decode a base64 string in C#?

var base64EncodedString;//Fill this with your data.
byte[] byteArray = Convert.FromBase64String(base64EncodedString);
string output = Encoding.UTF8.GetString(byteArray);
Tags :

Leave Your Comment

Liked this content?. Please spread the word :)