>_

Decimal to Octal

Type a decimal number below to get the octal value — other bases are shown too. The manual method is explained further down.

Try it

Custom base

Two’s complement

How to convert by hand

Divide by 8 repeatedly, note each remainder, then read the remainders from bottom to top:
493 ÷ 8 = 61 … 5
61 ÷ 8 = 7 … 5
7 ÷ 8 = 0 … 7
→ 755

Reference table

Decimal → Octal

0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 10
9 11
10 12
11 13
12 14
13 15
14 16
15 17
16 20
32 40
64 100
100 144
127 177
128 200
255 377
256 400
1000 1750
1024 2000
4096 10000
65535 177777

In code

JavaScript

(493).toString(8) // '755'

Python

format(493, 'o')  # '755'  (oct(493) → '0o755')

More examples

Open the full Number Base Converter →