ToolNimba

๐ŸŒ IP Address Validator (IPv4 and IPv6)

Shihab Mia By Shihab Mia ยท Updated 2026-08-01

Enter an IP address above and press Validate.

This IP address validator checks whether a string is a genuine IPv4 or IPv6 address and tells you what kind it is. Paste an address, press Validate, and you will see the version (IPv4 or IPv6), and for IPv4 the class plus whether it is private, public, loopback, or reserved. For IPv6 it notes whether the address uses compressed "::" notation and shows the fully expanded form. Everything runs in your browser, so nothing is sent anywhere, which makes this ip address validator safe to use even on internal or sensitive addresses.

What is the IP Address Validator?

An IP (Internet Protocol) address is the numeric label that identifies a device on a network. There are two versions in use today. IPv4 is a 32-bit address written as four decimal numbers (octets) from 0 to 255 separated by dots, such as 192.168.1.1, giving about 4.3 billion possible addresses. IPv6 is a 128-bit address written as eight groups of four hexadecimal digits separated by colons, such as 2001:0db8:0000:0000:0000:0000:0000:0001, giving an effectively unlimited supply. Validating an address means checking that it follows these exact rules: the right number of parts, each part within range, and the correct separators, which is exactly what an ip address validator like this one is built to do.

Strict validation matters because almost-correct strings are common and dangerous. A leading zero like 192.168.01.1 is ambiguous (some systems read it as octal), 256.0.0.1 is out of range, and an IPv6 string with two "::" compressions is undefined because the parser cannot tell how many zero groups each one represents. This tool rejects all of those. For IPv4 it requires exactly four octets, each 0 to 255 with no leading zeros. For IPv6 it allows one "::" to compress a run of zero groups, allows an embedded IPv4 tail such as ::ffff:192.0.2.1, and otherwise expects eight valid hex groups.

Knowing the scope of a valid address is just as useful as knowing it is valid. IPv4 reserves whole ranges for special jobs: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 are private (RFC 1918) and never appear on the public internet, 127.0.0.0/8 is loopback (your own machine), and 169.254.0.0/16 is link-local (APIPA) assigned automatically when DHCP fails. IPv6 has parallel ranges: ::1 is loopback, fe80::/10 is link-local, fc00::/7 is unique local, and ff00::/8 is multicast. The tool labels these so you can tell at a glance whether an address is routable on the public internet or confined to a local network.

Many developers reach for a regular expression to validate an IP address, and while a regex can catch obvious format errors, writing a fully correct one is harder than it looks. A naive IPv4 pattern like \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} will happily accept 999.999.999.999 because it does not check the numeric range of each octet, and it will also accept leading zeros unless the pattern is written carefully with negative lookaheads. IPv6 is worse: a correct regex needs to handle full-length addresses, single "::" compression at any position, and embedded IPv4 tails, which is why most production systems either use a battle-tested library or, like this ip address validator, parse the address field by field instead of relying on one giant pattern.

CIDR (Classless Inter-Domain Routing) notation often shows up next to an IP address, written as a slash followed by a prefix length, such as 192.168.1.0/24 or 2001:db8::/32. The prefix length is not part of the address itself, it describes a whole range of addresses that share the same leading bits, so a validator that checks a single address does not need a CIDR suffix, and adding one to a plain address check should be treated as a separate, invalid input for this tool. Understanding that distinction avoids a common source of false "invalid" reports when people paste a subnet instead of a single host address.

Dual-stack networks, where a device has both an IPv4 and an IPv6 address at the same time, are now the norm rather than the exception, and NAT64 or IPv4-mapped IPv6 addresses (the ::ffff:a.b.c.d form) exist specifically to bridge the two families during the long transition away from IPv4. Recognizing that a string like ::ffff:192.0.2.128 is valid IPv6 with an embedded IPv4 address, rather than rejecting it as malformed, is one of the details that separates a thorough ip address validator from a quick regex check.

When to use it

  • Checking that a user-entered IP in a form or config file is actually well-formed before you store or use it.
  • Confirming whether an address is private, public, or loopback when debugging a network or firewall rule.
  • Validating IPv6 addresses, including compressed "::" forms, that are easy to mistype by hand.
  • Teaching or learning the difference between IPv4 and IPv6 notation and the reserved address ranges.
  • Sanity-checking a log file, allowlist, or DNS record before deploying it, using an ip address validator instead of eyeballing dozens of entries.
  • Verifying an IPv4-mapped IPv6 address (such as ::ffff:203.0.113.1) that a dual-stack service reported.

How to use the IP Address Validator

  1. Type or paste an IPv4 or IPv6 address into the input field.
  2. Press Validate (or just keep typing, it checks as you go).
  3. Read the verdict: valid or invalid, plus the version and scope.
  4. For IPv4, note the class and whether it is private or public. For IPv6, see the expanded form and whether it is compressed.
  5. Use the IPv4 sample or IPv6 sample buttons to see an example, or Clear to start over.

Formula & method

IPv4: four octets a.b.c.d, each an integer 0 to 255, no leading zeros. 32-bit value = a ร— 2ยฒโด + b ร— 2ยนโถ + c ร— 2โธ + d. IPv6: eight 16-bit groups in hexadecimal separated by colons, with at most one "::" compressing one or more all-zero groups.

Worked examples

Validate 192.168.1.1 and find its scope.

  1. Split on dots: 192, 168, 1, 1 (four octets, good).
  2. Each octet is between 0 and 255 with no leading zero, so the form is valid.
  3. Leading octet 192 is in the range 192 to 223, so it is Class C.
  4. It matches 192.168.0.0/16, which is private (RFC 1918).
  5. 32-bit value = 192ร—16777216 + 168ร—65536 + 1ร—256 + 1 = 3232235777.

Result: Valid IPv4, Class C, Private (RFC 1918), 32-bit value 3232235777.

Validate the compressed IPv6 address 2001:db8::1.

  1. There is exactly one "::", which is allowed (it stands for a run of zero groups).
  2. Left of "::" is 2001:db8 (two groups), right is 1 (one group).
  3. The "::" expands to fill 8 minus 3 = 5 zero groups in the middle.
  4. Expanded form is 2001:0db8:0000:0000:0000:0000:0000:0001.
  5. The prefix 2001:db8 is the documentation range (2001:db8::/32).

Result: Valid IPv6, compressed notation, expands to 2001:0db8:0000:0000:0000:0000:0000:0001.

Why is 256.100.50.25 rejected?

  1. Split on dots: 256, 100, 50, 25 (four parts, so the shape looks right).
  2. The first octet is 256, but each octet must be 0 to 255.
  3. 256 is out of range, so the whole address fails validation.

Result: Invalid IPv4: the first octet 256 exceeds the maximum of 255.

Validate the IPv4-mapped IPv6 address ::ffff:192.0.2.128.

  1. The address starts with "::ffff:" which is the standard IPv4-mapped prefix.
  2. The tail, 192.0.2.128, is checked as its own valid IPv4 address (four octets, all 0 to 255).
  3. Combined with the "::ffff:" prefix, this represents an IPv4 address inside an IPv6 address.
  4. 192.0.2.0/24 is the TEST-NET-1 documentation range, so the embedded address is not routable either.

Result: Valid IPv6, IPv4-mapped form, embeds the documentation address 192.0.2.128.

IPv4 address classes by leading octet

ClassLeading octet rangeTypical use
A0 to 127Very large networks
B128 to 191Medium networks
C192 to 223Small networks
D224 to 239Multicast
E240 to 255Reserved (experimental)

Common reserved IPv4 ranges and what they mean

RangeScopeNotes
10.0.0.0/8PrivateRFC 1918, not routed publicly
172.16.0.0/12PrivateRFC 1918, covers 172.16 to 172.31
192.168.0.0/16PrivateRFC 1918, common home routers
127.0.0.0/8LoopbackYour own machine (localhost)
169.254.0.0/16Link-localAPIPA, auto-assigned when DHCP fails
100.64.0.0/10SharedCarrier-grade NAT (RFC 6598)
192.0.2.0/24DocumentationTEST-NET-1, reserved for examples only

Common reserved IPv6 ranges

PrefixScopeNotes
::1/128LoopbackEquivalent to IPv4 127.0.0.1
::/128UnspecifiedNo address assigned
::ffff:0:0/96IPv4-mappedEmbeds an IPv4 address for dual-stack use
fe80::/10Link-localOnly valid on the local link
fc00::/7Unique localPrivate addressing (ULA)
ff00::/8MulticastOne-to-many delivery
2000::/3Global unicastRoutable on the public internet

Common mistakes to avoid

  • Allowing leading zeros in IPv4 octets. Strings like 192.168.01.1 or 010.0.0.1 look fine but are ambiguous: some libraries read a leading zero as octal, so 010 becomes 8. This validator rejects leading zeros so the meaning is never in doubt.
  • Using more than one "::" in IPv6. The double colon stands for a run of zero groups, but it can appear at most once. With two of them, like 2001::25de::cade, the parser cannot tell how many zeros each one represents, so the address is invalid.
  • Octets out of range. Each IPv4 octet must be 0 to 255 because it is one byte. Values like 256 or 300 are common typos and are not valid, even though the dotted shape looks correct.
  • Confusing a private address with a public one. A valid address is not necessarily reachable from the internet. Ranges like 192.168.x.x and 10.x.x.x are private and only work inside a local network, so check the scope, not just validity.
  • Pasting a CIDR range instead of a single address. A string like 192.168.1.0/24 describes a whole block of addresses, not one host. Most single-address validators, including this one, expect just the address without the slash and prefix length.
  • Trusting a regex that skips numeric range checks. A quick pattern such as \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} matches the shape of an IPv4 address but will also accept 999.999.999.999, since it never checks that each part is 0 to 255. A reliable ip address validator has to parse and range-check every octet, not just match dots and digits.

Glossary

IPv4
A 32-bit IP address written as four decimal octets 0 to 255 separated by dots, for example 203.0.113.5.
IPv6
A 128-bit IP address written as eight groups of four hexadecimal digits separated by colons, for example 2001:db8::1.
Octet
One of the four numbers in an IPv4 address. Each is a single byte, so it ranges from 0 to 255.
Private address
An IP from a range reserved for internal networks (such as 192.168.0.0/16) that is never routed on the public internet.
Loopback
An address that refers back to the local machine itself: 127.0.0.1 in IPv4 and ::1 in IPv6.
Compression (::)
A shorthand in IPv6 where a single double colon replaces one or more consecutive groups of all zeros, allowed only once per address.
CIDR notation
A way to describe an address range as a prefix plus a slash and a bit length, such as 10.0.0.0/8.
IPv4-mapped address
An IPv6 address of the form ::ffff:a.b.c.d that embeds an IPv4 address, used by dual-stack systems to represent IPv4 traffic in IPv6 form.

Frequently asked questions

What makes an IP address valid?

For IPv4, the string must be exactly four numbers (octets) from 0 to 255 separated by dots, with no leading zeros, like 203.0.113.5. For IPv6, it must be eight groups of one to four hexadecimal digits separated by colons, with at most one "::" used to compress consecutive zero groups, like 2001:db8::1. This ip address validator checks both rule sets in your browser.

What is the difference between IPv4 and IPv6?

IPv4 is a 32-bit address (about 4.3 billion total) written in decimal with dots, while IPv6 is a 128-bit address written in hexadecimal with colons and provides a practically unlimited supply. IPv6 was introduced because the world ran out of free IPv4 addresses.

How do I know if an IP is private or public?

Private IPv4 ranges are 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16, and they only work inside a local network. Anything outside the reserved ranges is public and routable on the internet. The tool labels the scope for you, including loopback, link-local, and reserved ranges.

What does the "::" in an IPv6 address mean?

The double colon is shorthand for one or more consecutive groups that are all zeros. For example, 2001:db8::1 expands to 2001:0db8:0000:0000:0000:0000:0000:0001. It can be used only once in an address, otherwise the number of hidden zero groups would be ambiguous.

Why is 192.168.01.1 considered invalid here?

The octet 01 has a leading zero. Leading zeros are ambiguous because some systems interpret them as octal numbers, which changes the value. To avoid that risk this ip address validator treats any octet with a leading zero (other than a lone 0) as invalid.

Does this tool send my IP address anywhere?

No. All validation runs locally in your browser using plain JavaScript. Nothing you type is uploaded, logged, or stored, so you can safely check any address, including internal ones.

Can an IPv4 address contain letters?

No. A standard IPv4 address only ever contains digits and dots, four octets of 0 to 255 separated by three dots. If a string contains letters, it is either an IPv6 address (which uses hexadecimal digits a to f), a hostname, or simply invalid input.

Is 0.0.0.0 a valid IP address?

Yes, 0.0.0.0 is a syntactically valid IPv4 address, though it has a special meaning: it represents "this network" or, in many operating systems, "listen on all available interfaces" rather than a specific reachable host. The IPv6 equivalent is the unspecified address ::.

How many total IPv4 addresses exist?

There are 2 to the power of 32, which is 4,294,967,296 possible IPv4 addresses. A large share of that space is reserved for private networks, loopback, multicast, and other special uses, which is one of the main reasons the internet moved to IPv6.

What is the difference between validating an address and validating a CIDR range?

Validating a single address checks one host, like 192.168.1.10. Validating CIDR notation checks an address plus a prefix length, like 192.168.1.0/24, which describes an entire block of addresses. This ip address validator checks single addresses; if you paste a CIDR range, remove the slash and prefix first.