# 8进制到10进制在线转换工具

8进制8

10进制10

16进制16

2进制2

## 如何进行8进制到10进制转换?

dn-1dn-2...d2d1d0

Decimal Output = dn-1 × 8n-1 + ... + d1 × 81 + d0 × 80

Decimal Output = 2 × 83 + 0 × 82 + 2 × 81 + 3 × 80 = 1043

Decimal Output = 3 × 80 + 1 × 8-1 + 4 × 8-2 = 3.3125

## 8进制到10进制转换表:

8进制 10进制 8进制 10进制
1 1 30 24
2 2 40 32
3 3 50 40
4 4 60 48
5 5 70 56
6 6 100 64
7 7 110 72
10 8 120 80
11 9 130 88
12 10 140 96
13 11 150 104
14 12 160 112
15 13 170 120
16 14 200 128
17 15 300 192
20 16 200 512
21 17 300 768
22 18 400 256
23 19 500 320
24 20 600 384

## 用Python进行8进制到10进制转换:

```def octal_to_decimal(octal_str):
decimal_number = int(octal_str, 8)
return decimal_number

octal_input = '747'
decimal_output = octal_to_decimal(octal_input)
print('decimal result is:{0}'.format(decimal_output))

-------------------
decimal result is:487```

## 用Java进行8进制到10进制转换:

```public class NumberConvertManager {
public static int octal_to_decimal(String octal_str) {
return Integer.parseInt(octal_str, 8);
}

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

-------------------
decimal result is:487```