HCODX/Decimal to Octal
100% browser-based · Batch conversion · Optional 0o prefix

Decimal to Octal

Convert decimal numbers to octal (base 8). Unix file permissions are octal; this tool also covers the rare-but-real cases where octal is the right representation.

Decimal numbers
Octal values
Conversion options
Reverse (Octal → Decimal)
Input size
0 B
Output size
0 B
Numbers
0
Status
Ready
Example

Decimal in, octal out

Each decimal number is emitted in base 8. 420 in decimal is 644 in octal — the chmod code for read/write owner, read group, read other.

Decimal
8
64
420
Octal
10
100
644
Use cases

What you'll use this for

Octal lives on in Unix file permissions and a handful of legacy contexts — that's the niche this tool serves.

Unix file permissions

Compute chmod octal codes from desired bit-by-bit permissions.

CS homework

Verify base-10 to base-8 conversions for assignments.

Memory dumps

Convert raw decimal byte values to octal for systems that use it natively.

Compatibility with old systems

Some legacy tools and minicomputer manuals still favor octal.

Step by step

How to convert decimal to octal

1

Paste decimal numbers

One per line or separated by spaces or commas. Negative values are skipped.

2

Pick padding and prefix

Pad to 3 chars for chmod-style permissions, or longer widths for word-aligned octal.

3

Click Convert

Or leave auto-convert on for live updates. Runs entirely in your browser.

4

Copy or download

Copy to clipboard or save as .txt. Use the reverse tool to round-trip back to decimal.

FAQ

Frequently asked questions

Mostly file permissions (chmod 755), occasionally legacy systems. Hex is more common today.

Optional. Modern JS / Python recognize 0o for octal literals.

Yes.

53-bit JS limit.

About

About octal

Octal is base 8 — it uses the digits 0-7. Each octal digit represents exactly three binary bits, which is why it lines up so neatly with Unix file permission triplets (read / write / execute).

Where you'll see it

  • chmodchmod 755 file sets rwx for owner, rx for group and other.
  • Older systems — PDP-8/11 minicomputers used 12- and 16-bit words that displayed cleanly in octal.
  • Programming literals0o755 in JavaScript and Python, 0755 in C.

When to prefer hex

  • Hex (base 16) aligns with bytes and 32/64-bit words better than octal.
  • For anything other than file permissions, hex is almost always the right call.
  • If you need hex instead, jump to Binary to Hex or Hex to Binary.
Related

Related tools