Decimal to Octal Converter Online

Convert any decimal integer to octal (base-8) with step-by-step powers-of-8 expansion. Perfect for chmod values, batch mode for bulk conversion — 100% in your browser.

Enter a decimal number to see all four base representations.

What is decimal to octal conversion?

Decimal to octal conversion rewrites a base-10 integer using only the digits 0-7. Each octal digit is exactly 3 binary bits, which is why octal lives on in Unix file permissions (chmod), umask values, and a handful of historical computer architectures.

The OpenFormatter decimal-to-octal converter runs in your browser — no upload, no rate limit, no account. It shows the octal result, the equivalent binary and hex for context, and a digit-by-digit powers-of-8 expansion that explains the conversion.

How to convert decimal to octal — 4 steps

  1. Enter a decimal integer. Any non-negative value up to 253−1.
  2. Read the octal output. The result appears with the unambiguous 0o prefix; binary and hex are alongside.
  3. Study the expansion. Each octal digit is multiplied by its place value (8n) — useful for learning positional notation.
  4. Switch to batch mode. Convert many values at once and copy the table to a spreadsheet for bulk work.

Sample input and output

Input:  493

Output:
  Decimal: 493
  Octal:   0o755
  Binary:  111101101
  Hex:     0x1ED

Expansion: 493 = 7 × 8^2 (448) + 5 × 8^1 (40) + 5 × 8^0 (5) = 0o755

493 in octal is 755 — the most familiar chmod value: owner read/write/execute, group read/execute, others read/execute. Each octal digit cleanly packs three permission bits.

Single + Batch Modes

Convert one value with a full educational expansion, or paste hundreds of decimals (one per line) for a copyable table.

Educational Expansion

Powers-of-8 breakdown shows how each octal digit contributes — perfect for explaining why chmod uses three digits.

Client-Side Only

All math runs in the browser via Number.prototype.toString(8). Nothing is uploaded — verify in DevTools Network.

Common use cases

  • check_circleUnix file permissions — converting decimal mode bits to chmod 755 / 644 / 700 form
  • check_circleSetting umask values in shell profiles and Dockerfiles
  • check_circleReading historical computer architectures (PDP-8, PDP-11, ICL machines)
  • check_circleDecoding C escape sequences like \033 (ESC) or \007 (BEL)
  • check_circleWorking with cron output, sudoers files, and other text formats that surface octal
  • check_circleEducational demonstrations of positional number systems (base 8 sits between 2 and 10)
  • check_circleGenerating mode bits programmatically for chmod / chown / mkdir system calls
  • check_circleExploring relationships between bases when teaching computer fundamentals

The conversion math, explained

The tool calls JavaScript's Number.prototype.toString(8). That implements the standard division-by-8 algorithm: divide by 8, collect each remainder (0-7), and reverse. For 493 that's 493 ÷ 8 = 61 r5, 61 ÷ 8 = 7 r5, 7 ÷ 8 = 0 r7 — read bottom-up, that is 755. Equivalently, 493 = 7·82 + 5·81 + 5·80 = 448 + 40 + 5 = 493 — which is what the expansion panel shows.

Need the reverse direction?

Browse the rest of the OpenFormatter base toolkit — every conversion runs in your browser.

Frequently Asked Questions

What is octal?

Octal is a base-8 number system that uses the digits 0-7. Each octal digit represents exactly 3 binary bits, so octal is a compact shorthand for binary that predates hex. The most familiar use today is Unix file permissions (chmod 755), where each octal digit packs three permission bits — read, write, execute.

How does decimal to octal conversion work?

Repeatedly divide the decimal by 8 and record each remainder (0-7). Read the remainders in reverse to get the octal string. For 493: 493 ÷ 8 = 61 r5, 61 ÷ 8 = 7 r5, 7 ÷ 8 = 0 r7 → reading bottom-up gives 755. JavaScript uses (n).toString(8).

Why is octal used for file permissions?

Unix permissions are 9 bits — three groups of three (owner / group / other), each holding read / write / execute. Three bits is exactly one octal digit, so the 9-bit permission word fits in three octal digits: 755 means owner=7 (rwx), group=5 (r-x), other=5 (r-x). Octal makes the bit packing visible at a glance.

Is octal still used outside chmod?

Yes, in a few specific places: Unix umask values, certain BSD device-major numbers, traditional C escape sequences (\033 for ESC), and historical machine word formats like the PDP-8 and PDP-11. In modern day-to-day code, hex has largely replaced octal, but the chmod use keeps it culturally important.

Why does JavaScript treat 0123 specially?

In non-strict legacy JavaScript, a leading zero on a number literal (like 0123) was interpreted as octal — so 0123 = 83 decimal, not 123. Strict mode forbids this; modern code uses the explicit 0o prefix (0o123). This tool emits the unambiguous 0o prefix in its output.

What is the largest decimal I can convert?

Up to Number.MAX_SAFE_INTEGER (9,007,199,254,740,991 = 2^53 − 1). Above that, JavaScript number precision degrades. For arbitrarily large integers, use BigInt — but octal output of huge numbers is rarely useful in practice.

How do I convert chmod 755 back to permissions?

Each digit is three bits: 7=111 (rwx), 5=101 (r-x), 5=101 (r-x). So 755 means owner can read/write/execute, group and others can read/execute but not write. To produce 755 from rwxr-xr-x manually, sum the bits: r=4, w=2, x=1, then add per group.

Is the data sent to a server?

No. All conversion happens in JavaScript inside your browser. Open DevTools → Network and confirm zero requests when you click Convert. Safe for internal IDs, configuration, or data you cannot upload to a remote server.

Decimal to Octal Converter Online — Free Base-10 to Base-8 Tool