StringBuilder hex1 = new StringBuilder(length * 2); foreach (byte b in hex) hex1.AppendFormat("{0:x2}", b); textBox2.Text = hex.ToString();