Skip to content

Convert IPv4 Addresses: Binary to Dotted Decimal & Vice Versa

Overview: Mastering IPv4 Address Conversion

This session focuses on the essential skill of converting IPv4 addresses between dotted decimal (e.g., 192.168.1.1) and binary (e.g., 11000000.10101000.00000001.00000001) notation. The instructor emphasizes a simple, memorable technique using an 8-digit power-of-two sequence. Understanding the Structure of IPv4 Addresses provides the necessary foundation for this conversion work.

The Foundation: The 8-Bit Conversion Table

An IPv4 address is 32 bits long, organized into four octets of 8 bits each. The core of the conversion method is the sequence of 8 decimal values: 128, 64, 32, 16, 8, 4, 2, 1.

  • Easy to remember: Start with 1, then multiply by 2 until you reach 128.
  • Mathematical basis: This is 2 to the 7th power down to 2 to the 0th power (2^7, 2^6, 2^5... 2^0).

Method 1: Converting from Binary to Dotted Decimal

Goal: Take a 32-bit binary string and translate it into a human-readable dotted decimal format.

Steps:

  1. Break it down: Separate the 32-bit string into four 8-bit groups (octets).
  2. Place it in the table: For each octet, align the 8 bits (1s and 0s) under the 128, 64, 32, 16, 8, 4, 2, 1 table.
  3. Sum the values: Add up only the numbers where there is a binary 1.
  4. Repeat: Do this for all four octets to get four decimal numbers.

Example 1: Binary to Dotted Decimal

Input Binary: 10000001.00001011.01001011.11101111

  • Octet 1 (10000001): 128 + 1 = 129
  • Octet 2 (00001011): 8 + 2 + 1 = 11
  • Octet 3 (01001011): 64 + 8 + 2 + 1 = 75
  • Octet 4 (11101111): 128 + 64 + 32 + 8 + 4 + 2 + 1 = 239

Dotted Decimal Result: 129.11.75.239

Quick Trick for 239: All 8 bits set to 1 equals 255. 255 - 16 (the missing value) = 239.

Method 2: Converting from Dotted Decimal to Binary

Goal: Convert a dotted decimal IP address back into its binary form.

Steps:

  1. Start with the decimal number.
  2. Work left to right across the 128, 64, 32, 16, 8, 4, 2, 1 table.
  3. Check if the number is >= the table value.
    • If yes, mark a 1 for that position, subtract the table value from your number, and move to the next position.
    • If no, mark a 0 and move to the next position.
  4. Complete the 8 bits and repeat for the next octet.

Example 2: Dotted Decimal to Binary

Input Dotted Decimal: 145.14.6.8

  • Octet 1 (145): 145 >= 128 -> 1 (145-128=17). 17 >= 16 -> 1 (17-16=1). 1 >= 1 -> 1 (1-1=0). Remaining: 32, 8, 4, 2 are 0. Result: 10010001
  • Octet 2 (14): 14 >= 8 -> 1 (14-8=6). 6 >= 4 -> 1 (6-4=2). 2 >= 2 -> 1 (2-2=0). Remaining: 128, 64, 32, 16, 1 are 0. Result: 00001110
  • Octet 3 (6): 6 >= 4 -> 1 (6-4=2). 2 >= 2 -> 1 (2-2=0). Remaining: 128, 64, 32, 16, 8, 1 are 0. Result: 00000110
  • Octet 4 (8): 8 >= 8 -> 1 (8-8=0). Remaining: 128, 64, 32, 16, 4, 2, 1 are 0. Result: 00001000

Binary Result: 10010001.00001110.00000110.00001000

Key Takeaway & Homework

This systematic method ensures a unique, correct conversion for every possible IPv4 address. Practice is key to mastery. To deepen your understanding of how these addresses are organized, explore Classful Addressing Explained. For those preparing for certifications, Mastering CIDR and Subnetting is a logical next step.

Homework Problems:

  1. Convert 208.34.54.1 from dotted decimal to binary.
  2. Convert the binary address shown in the video to dotted decimal.

Keep this summary

Save it to LunaNotes and it becomes a real note in your library — editable, searchable, and ready to turn into flashcards or a diagram. Free to start.

Save to LunaNotes

Or summarise for another video.

This summary and transcript were automatically generated using AI with the Free YouTube Transcript Summary Tool by LunaNotes.

Related summaries

Understanding IPv4 Addresses: Structure, Notations, and Validity

Understanding IPv4 Addresses: Structure, Notations, and Validity

This lecture provides a comprehensive introduction to IPv4 addresses, covering their 32-bit structure, binary and dotted decimal notations, and how to identify valid versus invalid IP addresses. Learn about address space, uniqueness, and the role of NAT technology in managing billions of devices.

IPv4 Address Classes Explained: Class A, B, C, D, E Identification Guide

IPv4 Address Classes Explained: Class A, B, C, D, E Identification Guide

This tutorial provides a comprehensive breakdown of the five classes of IPv4 addresses (A, B, C, D, and E). Learn how to identify each class using binary notation and dotted decimal format, with clear examples and a practical activity to test your understanding.

Mastering CCNA Subnetting: CIDR and Efficient IP Addressing

Mastering CCNA Subnetting: CIDR and Efficient IP Addressing

This video provides a clear, step-by-step introduction to subnetting for the CCNA, focusing on CIDR (Classless Inter-Domain Routing) and the efficient allocation of IPv4 addresses. Learn the fundamentals of IPv4 classes, how subnetting solves IP address waste, and practice calculating subnet sizes to optimize network design.

Understanding Number Systems and Binary Conversion in Python

Understanding Number Systems and Binary Conversion in Python

This video tutorial explains the fundamentals of various number systems including binary, octal, decimal, and hexadecimal, focusing on their significance in programming. Learn how to convert decimal numbers to binary using Python's built-in functions and understand manual conversion techniques for accuracy and better comprehension. Practical examples and homework exercises enhance your grasp on number system conversions essential for programming tasks such as working with IP addresses and bitwise operations.

IP Address Classes and Subnet Mask: Network vs Host Portions Explained

IP Address Classes and Subnet Mask: Network vs Host Portions Explained

This video explains IPv4 address classes (A, B, C, D, E) and introduces the critical concept of the subnet mask. Learn how subnet masks differentiate the network and host portions of an IP address to determine whether devices are on the same or different networks.

Found this summary useful?

Take it with you. One click puts it in your own LunaNotes library.

Save to LunaNotes

Start taking better notes today with LunaNotes