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:
| Decimal | Breakdown | Octal |
|---|---|---|
| 192 | 3 × 64 + 0 × 8 + 0 | 0300 |
| 168 | 2 × 64 + 5 × 8 + 0 | 0250 |
| 254 | 3 × 64 + 7 × 8 + 6 | 0376 |
| 127 | 1 × 64 + 7 × 8 + 7 | 0177 |
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.