IPv4 parse
ipv4-parse · version 1.0.0 · URLs & IP addresses · free, no key needed
Parse a canonical dotted-decimal IPv4 address into octets and a uint32 integer string.
Use when you need to: ipv4 parse · parse dotted decimal ipv4 · ipv4 to octets and uint32.
Supported
- ipv4 parse
- parse dotted decimal ipv4
- ipv4 to octets and uint32
Not supported
- IPv6
- IPv4-mapped IPv6
- hexadecimal octets
- CIDR prefixes
- hostnames
- ports
Behavior
- address is four decimal octets 0-255 separated by dots, with no spaces, hex, or IPv4-mapped IPv6.
- A zero octet is written 0; 00, 01, and other leading zeros are rejected.
- octets is the four JSON integers in left-to-right order.
- integer is the canonical integer string of o0*2^24 + o1*2^16 + o2*2^8 + o3, in 0..4294967295.
Input
address(string, required): max length 15; pattern^(?:0|[1-9][0-9]{0,2})(?:\.(?:0|[1-9][0-9]{0,2})){3}$
Output
octets(array of integer, required): min items 4; max items 4; each min 0; each max 255integer(string, required): max length 10; pattern^(0|[1-9][0-9]*)$
Limits
- max address length: 15
- octet min: 0
- octet max: 255
- integer min: 0
- integer max: 4294967295
Example
Request input:
{
"address": "192.168.1.1"
}
Response:
{
"result": {
"octets": [
192,
168,
1,
1
],
"integer": "3232235777"
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "ipv4-parse",
"version": "1.0.0",
"input": {
"address": "192.168.1.1"
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/ipv4-parse/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"address":"192.168.1.1"}'
The machine-readable contract is at /v1/tools/ipv4-parse/versions/1.0.0.
CLI
node cli.mjs run ipv4-parse 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- IPv4 format: Format a uint32 integer string or four octets as a canonical dotted-decimal IPv4 address.
- IPv4 CIDR parse: Parse an IPv4 CIDR block into its network, broadcast, netmask, wildcard mask, usable host range and address counts.
- IPv6 parse: Parse an IPv6 address (any RFC 4291 textual form) into its 8 hextets and a 128-bit integer string.
- IPv4 address offset: Add a signed integer offset to an IPv4 address, throwing if the result leaves the IPv4 address space.
- IPv4 mask convert: Convert between an IPv4 prefix length, dotted subnet netmask, and dotted wildcard (host) mask.
- IPv4 range to cidrs: Convert an arbitrary IPv4 address range into the minimal list of CIDR blocks that exactly covers it.