# 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```