16进制到10进制在线转换工具

16进制16

10进制10

8进制8

2进制2

如何进行16进制到10进制转换?

dn-1dn-2...d2d1d0

Decimal Output = dn-1 × 16n-1 + ... + d1 × 161 + d0 × 160

Decimal Output = 15 × 161 + 4 × 160 = 244

Decimal Output = 11 × 163 + 2 × 162 + 9 × 161 + 14 × 160 = 45726

Decimal Output = 3 × 160 + 1 × 16-1 + 4 × 16-2 = 3.078125

16进制到10进制转换表:

16进制 10进制 16进制 10进制
1 1 20 32
2 2 30 48
3 3 40 64
4 4 50 80
5 5 60 96
6 6 70 112
7 7 80 128
8 8 90 144
9 9 A0 160
A 10 B0 176
B 11 C0 192
C 12 D0 208
D 13 E0 224
E 14 F0 240
F 15 100 256
10 16 200 512
11 17 300 768
12 18 1000 4096
13 19 2000 8192
14 20 3000 12288

用Python进行16进制到10进制转换:

```def hex_to_decimal(hex_str):
decimal_number = int(hex_str, 16)
return decimal_number

hex_input = 'ccccccccc'
decimal_output = hex_to_decimal(hex_input)
print('decimal result is:{0}'.format(decimal_output))

-------------------
decimal result is:54975581388```

用Java进行16进制到10进制转换:

```public class NumberConvertManager {
public static int hex_to_decimal(String hex_str) {
return Integer.parseInt(hex_str, 16);
}

public static void main(String[] args) {
String hex_input = "f4";
int decimal_output = hex_to_decimal(hex_input);
System.out.println("decimal result is:" + decimal_output);
}
}

-------------------
decimal result is:244```