Earn income with your C# skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest self-service freelancing marketplace for people like you.

How to encode and decode a base64 string in C#.

Use the 2 helpers methods below for encoding and decoding a base64 string.

public static string Base64Encode(string text)
     var textBytes = System.Text.Encoding.UTF8.GetBytes(text);
     return System.Convert.ToBase64String(textBytes);

public static string Base64Decode(string base64)
      var base64Bytes = System.Convert.FromBase64String(base64);
      return System.Text.Encoding.UTF8.GetString(base64Bytes);

Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Licensing       EULA       Sitemap      
© Data & Object Factory, LLC.
Made with    in Austin, Texas.      Vsn 1.3.0