Understand every IP address format, learn step-by-step conversions, and see why each representation matters in real networking.
- Dotted-decimal is the human-friendly format everyone knows, like
192.168.1.1. It is just one of several ways to write the same 32-bit number. - In binary, each octet becomes 8 bits. Understanding IP address binary is essential for subnetting, because subnet masks work through bitwise AND operations.
- The hexadecimal format condenses each octet into two hex digits. You see it in packet captures, IPv6, and low-level debugging.
- The integer format stores an IP as a single 32-bit number—databases use this for efficient storage and fast range queries.
- You can convert between IP formats instantly with a tool, but knowing the math builds real networking fluency.
When most people think of an IP address, they picture four numbers separated by dots: 192.168.1.1. That is the dotted-decimal IP address format, and it is designed to be easy for humans to read. But your computer does not think in decimal. It thinks in binary—ones and zeros.
The same address can also be written in hexadecimal, as a single large integer, or even in octal. Each IP address format exists because different contexts demand different representations. Network engineers converting IP to binary to calculate subnets. Developers storing IPs as integers for database efficiency. Security analysts reading hex in packet dumps. Same address, different lens.
This guide walks through every major IP address format. It shows you exactly how to convert between them with real math. It also explains when and why each one matters. IP addresses are just one type of network identifier. Devices also use MAC addresses at the hardware level. These identifiers work at different layers of the OSI model. Whether you are studying for a certification, writing network code, or just curious, this guide has you covered. You will leave able to read any IP address format with confidence.
The Dotted-Decimal Format
Dotted-decimal is the everyday IPv4 format, like 192.168.1.1. It splits the 32-bit address into four 8-bit octets. Each octet is written in decimal, from 0 to 255, separated by dots. It exists for one reason: people read decimal far more easily than binary.
Dotted-decimal notation is the standard IP address format for IPv4. It looks like this:
192.168.1.1
The address is made up of four groups called octets, separated by dots. Each octet represents 8 bits of the underlying 32-bit address. The term “octet” literally means a group of eight, referring to the 8 binary digits that make up each section.
Because each octet is 8 bits wide, the values run from 0 to 255. The smallest is 0, with all eight bits off. The largest is 255, with all eight bits on. If you ever see a number outside this range in an IP address, something is wrong.
192 . 168 . 1 . 1
| | | |
Octet 1 Octet 2 Octet 3 Octet 4
Each octet: 8 bits = values 0 through 255
Total: 4 octets x 8 bits = 32 bits
This format was chosen because humans are terrible at reading long strings of binary. Breaking the 32-bit address into four decimal numbers makes it manageable. You can quickly tell someone to ping 192.168.1.1, but try telling them to ping 11000000101010000000000100000001 over the phone.
Dotted-decimal is what you will see in router configurations, DNS records, firewall rules, and virtually every networking interface. When you check your public IP, the result comes back in this format.
Binary Format
Binary is the IP address as the computer sees it: a 32-bit string of ones and zeros. Each octet becomes 8 bits. Binary is essential for subnetting, because the subnet mask is applied with a bitwise AND. Decimal hides this layer, but the network runs on the bits.
Binary is the native IP address format as far as your computer is concerned. Every IP address is fundamentally a 32-bit binary number. The dotted-decimal notation is just a convenience layer on top of it.
To convert an IP address to binary, you convert each octet independently using positional values. Each bit position in an octet has a fixed value:
| Bit Position | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|
| Place Value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
The technique is simple. Start with the leftmost place value, 128. If the octet is greater than or equal to 128, write a 1 and subtract 128. If not, write a 0. Move to the next place value, 64, and repeat. Continue until all 8 bits are filled.
Octet 1: 192
192 ≥ 128? Yes → 1, remainder = 64
64 ≥ 64? Yes → 1, remainder = 0
0 ≥ 32? No → 0
0 ≥ 16? No → 0
0 ≥ 8? No → 0
0 ≥ 4? No → 0
0 ≥ 2? No → 0
0 ≥ 1? No → 0
Result: 11000000
Octet 2: 168
168 ≥ 128? Yes → 1, remainder = 40
40 ≥ 64? No → 0
40 ≥ 32? Yes → 1, remainder = 8
8 ≥ 16? No → 0
8 ≥ 8? Yes → 1, remainder = 0
0 ≥ 4? No → 0
0 ≥ 2? No → 0
0 ≥ 1? No → 0
Result: 10101000
Octet 3: 1
Result: 00000001
Octet 4: 1
Result: 00000001
Full IP address in binary:
11000000.10101000.00000001.00000001
Why Binary Matters for Subnetting
The real reason every networking student needs to understand IP address binary is subnetting. Your computer must decide whether a destination IP is local or needs routing. To do this, it performs a bitwise AND between the IP address and the subnet mask.
IP Address: 11000000.10101000.00000001.00000001 (192.168.1.1)
Subnet Mask: 11111111.11111111.11111111.00000000 (255.255.255.0)
─────────────────────────────────────
AND Result: 11000000.10101000.00000001.00000000 (192.168.1.0)
The result is the network address. Any device that produces
the same network address after the AND operation is on the
same local subnet.
This is entirely a binary operation. You cannot do it in decimal without first converting. That is why understanding IP to binary conversion is not optional—it is the foundation of every subnetting calculation. Our subnet calculator automates this. But knowing the mechanics yourself is what turns configuration into real understanding.
Hexadecimal Format
Hexadecimal is base-16, and each hex digit maps to exactly 4 bits. So one 8-bit octet becomes two hex digits. This makes hex a compact bridge between binary and decimal. You meet it in packet captures, IPv6 addresses, and low-level network code.
Hexadecimal (base-16) provides a compact way to represent binary data. Each hex digit represents exactly 4 bits, which means each 8-bit octet can be written as exactly 2 hex digits. This makes hexadecimal a natural middle ground. It is shorter than binary and closer to the bit patterns than decimal.
The hex digits are 0 through 9 and A through F. The letters map as A=10, B=11, C=12, D=13, E=14, and F=15.
Converting Decimal to Hex
To convert an octet to hex, divide by 16. The quotient is the first hex digit; the remainder is the second.
Octet 1: 192 ÷ 16 = 12 remainder 0 → C0
Octet 2: 168 ÷ 16 = 10 remainder 8 → A8
Octet 3: 1 ÷ 16 = 0 remainder 1 → 01
Octet 4: 1 ÷ 16 = 0 remainder 1 → 01
Hexadecimal IP address: C0.A8.01.01
With 0x prefix: 0xC0A80101
The 0x prefix comes from languages like C and Python. It signals that the number is in hexadecimal. You will see both dotted hex (C0.A8.01.01) and the flat form (0xC0A80101), depending on context.
Where Hex Shows Up
- Packet captures: Tools like Wireshark display raw packet data in hexadecimal. If you are analyzing network traffic, you are reading hex.
- IPv6 addresses: The entire IPv6 address format is hexadecimal (e.g.,
2001:0db8:85a3::8a2e:0370:7334). Understanding hex in IPv4 gives you a head start. Our IPv4 vs. IPv6 comparison covers the differences between both protocols. - MAC addresses: Written in hex, like
00:1A:2B:3C:4D:5E. If you work with both MAC and IP data, hex is the common language. - Low-level programming: Embedded systems, firmware, and network stack code frequently represent IP addresses in hexadecimal format.
Integer (32-bit) Format
The integer format treats the whole address as one unsigned 32-bit number. So 192.168.1.1 becomes 3232235777. Databases and logs use it for two reasons: it takes only 4 bytes, and range queries become simple integer comparisons.
Every IPv4 address can be expressed as a single unsigned 32-bit integer. This format treats the entire 32-bit number as one value. It does not split the address into four octets.
The formula is:
Integer = (Octet1 × 2^24) + (Octet2 × 2^16) + (Octet3 × 2^8) + Octet4
Which equals:
Integer = (Octet1 × 16,777,216) + (Octet2 × 65,536) + (Octet3 × 256) + Octet4
192 × 16,777,216 = 3,221,225,472
168 × 65,536 = 11,010,048
1 × 256 = 256
1 × 1 = 1
─────────────
Total: 3,232,235,777
So 192.168.1.1 = 3232235777 as a 32-bit integer.
Why Store IPs as Integers?
Databases and software often store IP addresses in integer format for two practical reasons:
- Storage efficiency: A 32-bit integer takes exactly 4 bytes. Storing the dotted-decimal string
"192.168.1.1"takes 11 to 15 bytes depending on the address. When you have millions of log entries, that difference adds up. - Range queries: Finding all IPs in a block becomes one integer comparison, like
WHERE ip_int BETWEEN 3232235776 AND 3232236031. String storage needs complex parsing or padding for the same result.
To convert an integer back to dotted-decimal, you reverse the process: divide repeatedly by 256 and take the remainders.
3232235777 ÷ 256 = 12625921 remainder 1 → Octet 4 = 1
12625921 ÷ 256 = 49319 remainder 1 → Octet 3 = 1
49319 ÷ 256 = 192 remainder 168 → Octet 2 = 168
Octet 1 = 192
Result: 192.168.1.1 (reading octets 1 through 4)
IP Address Classes
Classful addressing split IPv4 into classes A through E by the leading bits of the first octet. Classes A, B, and C were for unicast, D for multicast, and E reserved. CIDR replaced this system in 1993. The class labels survive as shorthand and on certification exams.
In the early internet, IPv4 addresses were divided into five classes. The split was based on the leading bits of the first octet. This system, called classful networking, set how many bits were network and how many were host.
| Class | First Octet Range | Leading Bits | Default Mask | Networks | Hosts per Network |
|---|---|---|---|---|---|
| A | 1 – 126 | 0xxxxxxx |
255.0.0.0 |
126 | 16,777,214 |
| B | 128 – 191 | 10xxxxxx |
255.255.0.0 |
16,384 | 65,534 |
| C | 192 – 223 | 110xxxxx |
255.255.255.0 |
2,097,152 | 254 |
| D | 224 – 239 | 1110xxxx |
N/A | Reserved for multicast | |
| E | 240 – 255 | 1111xxxx |
N/A | Reserved for experimental use | |
Classful networking was replaced by CIDR (Classless Inter-Domain Routing) in 1993 because the fixed class sizes were wildly inefficient. A company needing 300 addresses would get an entire Class B with 65,534 host slots—wasting tens of thousands of addresses. CIDR allows subnet masks of any length, so you can allocate exactly what you need. Our subnetting guide walks through CIDR notation and subnet calculations step by step. For a focused breakdown of the slash number itself, see CIDR Notation Explained.
Despite being technically obsolete, IP address classes still matter. Certification exams test them, and the private ranges are defined by class. Networking professionals also use the class labels as everyday shorthand.
What about Class E? The 240.0.0.0/4 block stays reserved today. A long-running IETF proposal to open it for normal unicast use (draft-schoen-intarea-unicast-240) expired in 2025 with no adoption. Many operating systems already accept 240/4 on private networks, and large clouds use it internally. But it is still not routable on the public internet.
Private Address Ranges
RFC 1918 reserved specific blocks within Classes A, B, and C for private (non-routable) use. These are the addresses used on internal networks behind routers and firewalls:
| Class | Private Range | CIDR Notation | Total Addresses |
|---|---|---|---|
| A | 10.0.0.0 – 10.255.255.255 |
10.0.0.0/8 |
16,777,216 |
| B | 172.16.0.0 – 172.31.255.255 |
172.16.0.0/12 |
1,048,576 |
| C | 192.168.0.0 – 192.168.255.255 |
192.168.0.0/16 |
65,536 |
Have you connected to home Wi-Fi and seen an IP starting with 192.168? That is a Class C private address. Enterprise networks tend to use the 10.x.x.x range because it offers far more addresses for large-scale internal use. For more on how private and public addresses interact, see our guide on public vs. private IP addresses.
Special and Reserved Addresses
Several IPv4 blocks are reserved for specific jobs, not normal hosts. Examples include 127.0.0.0/8 for loopback and 169.254.0.0/16 for link-local APIPA. Others cover multicast, broadcast, documentation, and carrier-grade NAT. Knowing them speeds up troubleshooting and shows up on certification exams.
Not every IP address format value is available for regular use. Several blocks are reserved for specific functions defined by various RFCs. Knowing these is essential for troubleshooting and certification exams alike.
| Address / Range | Name | Purpose |
|---|---|---|
127.0.0.1 |
Loopback | Points back to the local machine. Used for testing the TCP/IP stack without network access. The entire 127.0.0.0/8 block is reserved for loopback. |
255.255.255.255 |
Limited Broadcast | Sends a packet to every device on the local network segment. Routers do not forward this. |
0.0.0.0 |
Default / Unspecified | Represents “no specific address.” Used in routing tables as the default route and by DHCP clients before they receive an address. |
169.254.0.0/16 |
APIPA (Link-Local) | Automatically assigned when a device cannot reach a DHCP server. If you see a 169.254.x.x address, it usually means DHCP failed. |
100.64.0.0/10 |
Shared Address Space (CGNAT) | Reserved by RFC 6598 for carrier-grade NAT. ISPs place it between customer routers and the public internet, kept separate from RFC 1918 ranges. |
224.0.0.0 – 239.255.255.255 |
Multicast | Used for one-to-many communication. Protocols like OSPF (224.0.0.5) and streaming media use multicast addresses. |
192.0.2.0/24 |
TEST-NET-1 | Reserved for documentation and examples (RFC 5737). Safe to use in tutorials without conflicting with real networks. |
198.51.100.0/24 |
TEST-NET-2 | Another documentation-only block defined in RFC 5737. |
203.0.113.0/24 |
TEST-NET-3 | Third documentation block from RFC 5737. Used in examples and training materials. |
Understanding these reserved addresses prevents common mistakes. For example, a server set to listen on 0.0.0.0 does not lack an IP. It is listening on every available interface. And a user whose IP is 169.254.x.x has a DHCP problem, not DNS or routing. You can check any address with a reverse DNS lookup to see what it resolves to.
Converting Between Formats
Converting between formats follows fixed rules you can do by hand. Use place values to move between decimal and binary. Divide by 16 for hexadecimal. Use powers of 256 for the integer form. The table below shows two addresses in all four formats at once.
Here is a quick-reference walkthrough for converting the IP address format in each direction. We will use 10.0.75.200 as our example throughout.
Decimal to Binary
For each octet, use the subtraction method with place values 128, 64, 32, 16, 8, 4, 2, 1:
10 = 0 + 0 + 0 + 0 + 8 + 0 + 2 + 0 = 00001010
0 = 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 = 00000000
75 = 0 + 64 + 0 + 0 + 8 + 0 + 2 + 1 = 01001011
200 = 128 + 64 + 0 + 0 + 8 + 0 + 0 + 0 = 11001000
Binary: 00001010.00000000.01001011.11001000
Binary to Decimal
For each 8-bit group, add up the place values where the bit is 1:
00001010 = 8 + 2 = 10
00000000 = 0 = 0
01001011 = 64 + 8 + 2 + 1 = 75
11001000 = 128 + 64 + 8 = 200
Decimal: 10.0.75.200
Decimal to Hexadecimal
Divide each octet by 16. The quotient is the first hex digit, the remainder is the second:
10 ÷ 16 = 0 remainder 10 → 0A
0 ÷ 16 = 0 remainder 0 → 00
75 ÷ 16 = 4 remainder 11 → 4B
200 ÷ 16 = 12 remainder 8 → C8
Hex: 0A.00.4B.C8 (or 0x0A004BC8)
Decimal to Integer
10 × 16,777,216 = 167,772,160
0 × 65,536 = 0
75 × 256 = 19,200
200 × 1 = 200
─────────────
Total: 167,791,560
So 10.0.75.200 = 167791560 as a 32-bit integer.
All Formats at a Glance
| Format | 192.168.1.1 | 10.0.75.200 |
|---|---|---|
| Dotted-Decimal | 192.168.1.1 |
10.0.75.200 |
| Binary | 11000000.10101000.00000001.00000001 |
00001010.00000000.01001011.11001000 |
| Hexadecimal | C0.A8.01.01 |
0A.00.4B.C8 |
| Integer | 3232235777 |
167791560 |
To verify your work or convert a batch quickly, use our IP address converter. It shows results in all formats at once.
Related Tools & Resources
Put these formats into practice with our free networking tools. Convert any address across binary, hex, and integer, or check your public IP in seconds. Each tool runs in your browser, with nothing to install. The guides below go deeper on subnetting and addressing.
- IP Address Converter — convert any address across binary, hexadecimal, and integer formats.
- Subnet Calculator — work out network and host ranges from any CIDR block.
- CIDR Notation Explained — how to read any /8 through /32 prefix.
- What Is My IP Address — see your own public IP in dotted-decimal.
- IPv4 vs IPv6 — how the two address formats differ.
- Public vs Private IP Addresses — where the RFC 1918 ranges fit.
Frequently Asked Questions
Short answers to the questions people ask most about IP address formats. These cover why dotted-decimal exists, how to convert to binary by hand, and when each format is used.
Why do IP addresses use dotted-decimal notation?
Dotted-decimal exists purely for human readability. The underlying address is a 32-bit binary number, which people cannot read easily. Splitting the 32 bits into four 8-bit octets, each shown as a decimal from 0 to 255, makes it manageable. You can say it aloud, type it, or write it down. The dots simply separate the four octets.
How do I convert an IP address to binary by hand?
Take each octet on its own and use the subtraction method. Write the place values: 128, 64, 32, 16, 8, 4, 2, 1. Starting at 128, if the octet is at least the place value, write 1 and subtract it. Otherwise write 0. Work through all 8 positions. For example, 200 gives 11001000. Repeat for each octet and join them with dots.
What is the hexadecimal format used for?
Hexadecimal shows up most in packet analysis tools like Wireshark, where raw data is displayed in hex. It is also the native format of IPv6 addresses. Programmers working with sockets, embedded systems, or low-level protocols meet it often. Hex is handy because each digit maps to exactly 4 bits. That makes hex-to-binary conversion quick and lossless.
Why would I store an IP address as an integer?
Integer storage gives two advantages: space and speed. A 32-bit integer takes exactly 4 bytes, while the string 255.255.255.255 takes 15. Integers also make range queries simple. Finding every IP in a subnet becomes a BETWEEN query on one indexed column. That is far faster than parsing dotted-decimal strings. Most IP geolocation databases and large log systems store integers for this reason.
What is the difference between Class A, B, and C networks?
The classes differ in how they split the 32 bits between network and host. Class A uses 8 network bits (first octet 1 to 126), giving over 16 million hosts each. Class B uses 16 network bits (128 to 191), with 65,534 hosts. Class C uses 24 network bits (192 to 223), leaving 254 hosts. CIDR replaced classful allocation, but the labels still appear as shorthand and on the CCNA and Network+ exams.
What is the 127.0.0.1 loopback address?
127.0.0.1 is the IPv4 loopback address, which always points back to the local machine. When you ping it, the traffic never leaves your computer. It goes down the TCP/IP stack and straight back up. This tests whether networking software works, with no physical connection needed. The whole 127.0.0.0/8 block is reserved for loopback. It is also known by the hostname localhost.
References
Every fact here is backed by primary sources. The list below links the core IETF RFCs and the IANA special-purpose address registry. It also links the proposal to reuse Class E space.
- RFC 791 — Internet Protocol. rfc-editor.org/rfc/rfc791
- RFC 1918 — Address Allocation for Private Internets. rfc-editor.org/rfc/rfc1918
- RFC 4632 — Classless Inter-Domain Routing (CIDR). rfc-editor.org/rfc/rfc4632
- RFC 5737 — IPv4 Blocks Reserved for Documentation. rfc-editor.org/rfc/rfc5737
- RFC 6598 — IANA-Reserved IPv4 Prefix for Shared Address Space. rfc-editor.org/rfc/rfc6598
- IANA IPv4 Special-Purpose Address Registry. iana.org
- Unicast Use of the Formerly Reserved 240/4 (expired Internet-Draft). datatracker.ietf.org