IP address validator
Check whether a string is a valid IP address, and see what each program would really connect to.
More in IP and subnets · Check and classify
Why a valid-looking address can mean something else
The same text can be refused by one program and read as an address by another. A strict parser, as in Python or Go, refuses 012.0.0.1 because of the leading zero. The tools that open the connection, such as curl and ping, read it as octal and connect to 10.0.0.1. A filter that checks the text as written lets it through, and that gap is how server-side request forgery (SSRF) filters get bypassed.
This page shows the strict answer and what each kind of reader gets, side by side, with the arithmetic. It says plainly when an address in disguise lands on a private, loopback or link-local address. It decodes; it has no control that makes an address look like another.
The three readers
| Reader | Used by | What it does with 012.0.0.1 |
|---|---|---|
| Strict (RFC 791 and RFC 4291) | Python ipaddress, Go netip, Django after the fix | Refuses it: the leading zero is ambiguous |
| WHATWG URL parser | Browsers, Node fetch | Reads it as 10.0.0.1 (octal 012 is 10) |
| inet_aton | curl, ping and most C tools | Reads it as 10.0.0.1 |
A row that reads the same address as the strict reader is marked the same. A row that reads another address is a warning. A row that refuses the text is neutral, because refusing is the right answer. Real outputs behind the table were taken from Python, Node, inet_aton and ping; SANS ISC diary 30348 shows 010.010.010.010 reaching 8.8.8.8, and the fix for CVE-2021-33571 made Django refuse leading zeros.
Forms that read as another address
| Written as | Browsers and curl read it as | Why |
|---|---|---|
012.0.0.1 | 10.0.0.1 | A leading zero means octal: 012 is 10 |
010.010.010.010 | 8.8.8.8 | Each 010 is octal for 8 |
127.1 | 127.0.0.1 | A short form: the last number fills the remaining 24 bits |
0x7f.1 | 127.0.0.1 | Hex 0x7f is 127, then the short form |
2130706433 | 127.0.0.1 | One whole number is the 32 bits of the address |
1.2.3 | 1.2.0.3 | The last number fills 16 bits |
256.1.1.1 | refused by every reader | A part is above 255 |
Brackets, ports, zone ids and URLs
You can paste an address the way it was written: [2001:db8::1]:443, fe80::1%eth0 or http://[::1]:8080/. The page removes the wrapper, names what it removed, and validates the address inside. A wrapper is never a reason to refuse the line. An IPv6 address with a dotted tail, such as ::ffff:192.168.0.1, is valid; browsers rewrite it as [::ffff:c0a8:1], which is the same address.
What happens to what you paste
With JavaScript on, the text is read in your browser and nothing you paste is sent to us or saved. Without JavaScript, the form asks our server, which reads the page address, answers and keeps nothing; the address holds what you typed, so share it only if you mean to. See the privacy policy.
Questions people ask
Is 127.1 a valid IP address?
Not to a strict parser. Browsers and tools such as ping read it as 127.0.0.1, the computer you are on. That difference is why the page shows each reader separately.
What is an internal address in disguise?
A text that a strict parser refuses, but that a browser or curl reads as a private, loopback or link-local address, such as 0251.0376.0251.0376, which reads as 169.254.169.254, the address cloud servers use for their own settings and keys. A filter that checks the text may miss it; the connection does not.
How do I validate an address safely in code?
Parse it with a strict library and check the parsed address, never the text. The page gives tested snippets for Python, Go and Node, and an IPv4 regex that refuses leading zeros and short forms. Use a library for IPv6.
Does the validator send what I paste anywhere?
No. With JavaScript it reads your text in the browser. Without JavaScript the form asks our server for that one request, and nothing is kept.
Use it from AI, the API or the command line
Every LookupOwl tool is also a free API and an MCP tool, with no key and no account. This one is ip_validate. Please be kind to the rate limits.
curl "https://lookupowl.com/api/v1/tools/ip-validate?q=012.0.0.1"claude mcp add --transport http lookupowl https://lookupowl.com/mcp