Skip to content
PithLab

↑↓ to move · Enter to open · Esc to close

IP Address Converter API

Convert an IP address between dotted decimal, decimal integer, hex, binary, octal and IPv6 forms (IPv4-mapped included).

POST /api/v1/tools/ip-address-converterMCP ip_address_converterNetwork Tools

Convert IPv4 and IPv6 addresses to and from integer, hex, binary and octal, and get the IPv4-mapped IPv6 form. The input format is detected for you.

Input

Send these as a JSON object. Unknown fields are rejected.

input
An IPv4 or IPv6 address, or a number such as 3232235777, 0xC0A80101 or 0b1100…. (string, up to 200 characters, required)
format
How to read the input; auto detects it. (string, one of auto, dotted, integer, hex, binary, octal, ipv6, default "auto")
curl https://pithlab.com/api/v1/tools/ip-address-converter \n  -H "Authorization: Bearer $PITHLAB_KEY" \n  -H "Content-Type: application/json" \n  -d '{"input":"192.168.1.1"}'
Example response
{
  "ok": true,
  "result": {
    "version": 4,
    "detected": "Dotted decimal (IPv4)",
    "conversions": [
      {
        "label": "Dotted decimal",
        "value": "192.168.1.1"
      },
      {
        "label": "Integer",
        "value": "3232235777"
      },
      {
        "label": "Hex",
        "value": "0xc0a80101"
      },
      {
        "label": "Dotted hex",
        "value": "c0.a8.01.01"
      },
      {
        "label": "Binary",
        "value": "11000000101010000000000100000001"
      },
      {
        "label": "Dotted binary",
        "value": "11000000.10101000.00000001.00000001"
      },
      {
        "label": "Octal",
        "value": "0o30052000401"
      },
      {
        "label": "Dotted octal",
        "value": "0300.0250.01.01"
      },
      {
        "label": "IPv4-mapped IPv6",
        "value": "::ffff:192.168.1.1"
      },
      {
        "label": "IPv4-mapped IPv6 (hex)",
        "value": "::ffff:c0a8:101"
      },
      {
        "label": "IPv4-mapped IPv6 (expanded)",
        "value": "0000:0000:0000:0000:0000:ffff:c0a8:0101"
      }
    ]
  }
}