Decimal to Octal Converter
Type decimal integers and get their exact octal form, with a 0o prefix, grouping or fixed-width two’s complement when you need it.
Processed locally in your browser· Your data stays in your browser.
What is Decimal to Octal Converter?
Converting to octal means repeatedly dividing by 8 and reading the remainders backwards, or grouping the binary form three bits at a time. The result uses only the digits 0 to 7. Octal is still the notation of Unix permission modes: read = 4, write = 2 and execute = 1 add up to one digit per user class, so 493 becomes 755.
This tool reads one integer per line and works with arbitrary-precision arithmetic, so a 30-digit decimal is converted without rounding. Negative numbers can be written with a minus sign or as an 8, 16, 32 or 64-bit two’s-complement pattern (−1 in 8 bits is 377). You can add the 0o prefix, group digits by 3 or 4 and pad to a fixed number of digits.
How does it work?
- Enter one decimal integer per line, for example 493 or -5.
- Choose how negatives are written: with a minus sign or as two’s complement in a fixed bit width.
- Turn on the 0o prefix, digit grouping or padding if your target needs it.
- Copy the octal output; for a single number the rows also show binary, hexadecimal and bit length.
Common use cases
- Finding the chmod mode for a permission value given in decimal, such as 493 for 755.
- Preparing octal literals for Python (0o755), JavaScript, Rust or a C source file.
- Producing octal escape codes or fixed-width octal fields for a tar, cpio or legacy file format.
- Checking that a hand conversion for an exam or exercise is correct.
Examples
Try this input in the tool above:
493 511 -5 123456789012345678901234567890
755 777 -5 143564417755415637016711617605322
Privacy
Decimal to Octal Converter runs entirely in your browser. The text or files you provide are processed on your device and are not uploaded, logged or stored on our servers.
Limitations
Only whole numbers are converted (fractions belong in the Base Converter). Two’s complement output requires the value to fit in the chosen width, otherwise an error is shown.
Frequently asked questions
What is 493 in octal?
493 in decimal is 755 in octal, since 7×64 + 5×8 + 5 = 493. That is the familiar chmod 755 mode.
How is a negative number shown in octal?
By default with a minus sign, for example −5 stays −5. With two’s complement 8-bit, −5 becomes 373, which is the octal writing of the bit pattern 11111011.
Does the 0o prefix change the value?
No. 0o755 and 755 are the same number. The prefix only tells languages such as Python, JavaScript and Rust that the literal is octal; older C code uses a plain leading 0.
Related tools
Octal to Decimal Converter
Paste octal numbers such as 755 or 0o777 and get their exact decimal value, optionally read as a signed two’s-complement pattern.
Developer Tools
Base Converter (Base 2 to 36)
Type a number, pick its base and the base you want, and get an exact result with a quick view in binary, octal, decimal, hexadecimal and base 36.
Developer Tools
Decimal to Binary Converter
Turn decimal integers into binary, including negative numbers as two’s complement at the bit width you need.
Developer Tools
Decimal to Hex Converter
Turn decimal integers into hexadecimal, with byte grouping, a 0x prefix and fixed-width two’s complement for negative values.
Developer Tools
Text to Octal Converter
Write your text as base-8 byte values, for example "Hi" → 110 151, or as \110\151 escapes.
Encoding & Decoding
Octal to Text Converter
Paste octal byte values such as 110 145 154 154 157 or \110\145\154 and read the text.
Encoding & Decoding
Binary to Decimal Converter
Read binary as a decimal number, either as a plain unsigned value or as a signed two’s complement integer.
Developer Tools
Hex to Decimal Converter
Read hexadecimal values as decimal numbers, unsigned or as signed two’s complement integers of 8 to 64 bits.
Developer Tools