Home .NET ASP.NET Converting Hexadecimal string to byte .NETASP.NET Converting Hexadecimal string to byte[] By Raúl Ribeiro - 07/09/2005 89 0 FacebookTwitterLinkedinWhatsApp string hexString = txtHex.Text; int discarded; txtByteCount.Text = ((int)HexEncoding.GetByteCount(hexString)).ToString(); txtLength.Text = hexString.Length.ToString(); byte[] byteArray = HexEncoding.GetBytes(hexString, out discarded); RELATED ARTICLESMORE FROM AUTHOR ASP.NET Integration Tests in .NET WebApi .NET Smaller .NET 6 docker images .NET TWIL: The weird way .NET’s config system parses JSONs C# .NET EF Core 6 support for groupby top(n) queries Design/Integration Patterns How to Handle known Exceptions? LEAVE A REPLY Cancel reply Please enter your comment! Please enter your name here You have entered an incorrect email address! Please enter your email address here Save my name, email, and website in this browser for the next time I comment. Δ