Format byte with X4
using System; public class MainClass{ public static void Main(){ byte[] byteValues = { 12, 163, 255 }; foreach (byte byteValue in byteValues) Console.WriteLine(byteValue.ToString("X4")); } }