FormatterHQ

IP to Octal Converter

Write an IPv4 address in dotted octal notation, with each octet as a zero-prefixed base-8 number.

Loading tool…
Ready.

How to use the IP to Octal Converter

  1. Type or paste an IPv4 address in normal dotted-decimal form into the address field.
  2. The Octal row updates as you type; each octet becomes a four-character octal value starting with 0.
  3. Copy the dotted octal address with the button on its row for your tests or documentation.

IP to octal: dotted base-8 notation

Octal is base 8, and an IP to octal conversion writes each octet of an IPv4 address in that base. The converter prefixes every octet with a zero and pads it to four characters, so 192.168.1.1 becomes 0300.0250.0001.0001. The leading zero is not decoration: in C and many languages descended from it, a number that starts with 0 is read as octal.

The math for each octet

Split the octet into multiples of 64, 8 and 1:

DecimalBreakdownOctal
1923 × 64 + 0 × 8 + 00300
1682 × 64 + 5 × 8 + 00250
2543 × 64 + 7 × 8 + 60376
1271 × 64 + 7 × 8 + 70177
192.168.1.1       →  0300.0250.0001.0001
127.0.0.1         →  0177.0000.0000.0001
255.255.255.255   →  0377.0377.0377.0377

Why octal IP addresses still matter

Almost nobody writes addresses in octal on purpose, but the classic BSD function inet_aton() accepts it. Each part is read as hexadecimal if it starts with 0x, octal if it starts with 0, and decimal otherwise. As a result, 0177.0.0.1 is loopback, and 192.168.010.001 is parsed as 192.168.8.1, not 192.168.10.1.

This has real security consequences. A filter that blocks the string "127.0.0.1" but hands the original input to a library using inet_aton() can be bypassed with the octal spelling. The opposite also happens: in 2021, both the npm netmask package and Python's ipaddress module were changed after leading zeros were interpreted differently from other software. The safe pattern is to parse once, normalize to plain dotted decimal, and make every decision on that normalized value.

Test cases for your own address validation

If you maintain code that accepts IP addresses or URLs, for example a webhook or image-fetch feature that must refuse internal hosts, check that it treats all of these spellings of loopback the same way. Each one is read as 127.0.0.1 by inet_aton()-style parsers:

0177.0000.0000.0001   dotted octal, as produced here
0177.1                two-part form: last part fills the remaining 24 bits
0x7f.0.0.1            hexadecimal first octet
2130706433            the whole address as one decimal number

The robust fix is the one described above: parse the input once with a strict parser, convert it to canonical dotted decimal, reject octets with leading zeros if your application has no reason to accept them, and run allow or deny checks only on the normalized form.

How this converter reads your input

With Input format on Auto or Dotted, a zero-padded octet like 010 is read as ordinary decimal ten and converts to 0012; Auto treats an address as octal only when one of its parts has four digits, as in 0177.0.0.1. If you want to see how an octal-aware parser would interpret a suspicious address, paste it into Octal to IP instead. For single numbers, Decimal to Octal shows the base conversion step by step, and IP to Decimal gives the 32-bit integer.

Everything runs in your browser; no addresses are sent anywhere.

Frequently asked questions

What is 127.0.0.1 in octal?
It is 0177.0000.0000.0001, often shortened to 0177.0.0.1. Many systems that use inet_aton() treat it as the loopback address.
Why does each octal octet start with 0?
In C-style parsers a leading zero marks a number as octal. Without it, 300 would be read as decimal 300, which is not a valid octet.
Why does 192.168.010.1 point to a different host?
Parsers that follow inet_aton() read 010 as octal, which is 8, so the address becomes 192.168.8.1. Avoid zero-padding octets in configuration files for this reason.
Do browsers accept octal IP addresses?
Browsers that follow the WHATWG URL standard do: http://0177.0.0.1/ resolves to 127.0.0.1. That is one reason URL filters must normalize hosts before checking them.

Last updated October 3, 2026

Related tools