Hex to Decimal decimal , _ := strconv . ParseInt ( "0x1c8" , 16 , 64 ) decimal : 456 Decimal to Hex var hexstring string hexstring, _ =strconv.FormatInt( 255,16) strconv . FormatInt ( 255 , 16 ) h := fmt . Sprintf ( "%x" , i )