Skip to content
PithLab

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

IP Address Converter (Decimal, Hex, Binary)

Convert IP addresses between dotted, integer, hex, binary and octal.

Use via API

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

POST https://pithlab.com/api/v1/tools/ip-address-converter

curl https://pithlab.com/api/v1/tools/ip-address-converter \
  -H "Authorization: Bearer $PITHLAB_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":"192.168.1.1"}'

Fields and responseOpenAPI documentGet an API key

About the IP Address Converter

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.

How to use the IP Address Converter

  1. Type or paste an address or number: 192.168.1.1, 3232235777, 0xC0A80101, 0b1100..., 2001:db8::1 or a large IPv6 integer.
  2. Leave Input format on Auto-detect, or pick a format if the input is ambiguous, such as hex digits with no letters.
  3. Every other representation appears below at once. Copy a single value or copy them all.

Examples

IPv4 dotted decimal

Input

192.168.1.1

Output

Dotted decimal: 192.168.1.1
Integer: 3232235777
Hex: 0xc0a80101
Dotted hex: c0.a8.01.01
Binary: 11000000101010000000000100000001
Dotted binary: 11000000.10101000.00000001.00000001
Octal: 0o30052000401
Dotted octal: 0300.0250.01.01
IPv4-mapped IPv6: ::ffff:192.168.1.1
IPv4-mapped IPv6 (hex): ::ffff:c0a8:101
IPv4-mapped IPv6 (expanded): 0000:0000:0000:0000:0000:ffff:c0a8:0101
32-bit integer back to IPv4

Input

3232235777

Output

Dotted decimal: 192.168.1.1
Integer: 3232235777
Hex: 0xc0a80101
Dotted hex: c0.a8.01.01
Binary: 11000000101010000000000100000001
Dotted binary: 11000000.10101000.00000001.00000001
Octal: 0o30052000401
Dotted octal: 0300.0250.01.01
IPv4-mapped IPv6: ::ffff:192.168.1.1
IPv4-mapped IPv6 (hex): ::ffff:c0a8:101
IPv4-mapped IPv6 (expanded): 0000:0000:0000:0000:0000:ffff:c0a8:0101
IPv6 to a 128-bit integer

Input

2001:db8::1

Output

Compressed: 2001:db8::1
Expanded: 2001:0db8:0000:0000:0000:0000:0000:0001
Integer: 42540766411282592856903984951653826561
Hex: 0x20010db8000000000000000000000001
Binary: 00100000000000010000110110111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001

Frequently asked questions

How does auto-detect decide between IPv4 and IPv6?

Anything with a colon is IPv6 and anything with dots is IPv4. Plain numbers up to 4,294,967,295 are IPv4 and larger ones are IPv6. Hex longer than 8 digits, or binary longer than 32 digits, is treated as IPv6.

Is a number like 12345678 hex or decimal?

Digits alone are read as decimal. Add 0x in front, or set Input format to Hexadecimal, to read it as hex. Input containing a to f is read as hex automatically.

Why would I convert an IP address to an integer?

Databases often store addresses as integers because they are compact and easy to compare, so range checks become simple number comparisons. Some logs and APIs also report addresses this way.

What is an IPv4-mapped IPv6 address?

It is how a dual-stack system shows an IPv4 peer on an IPv6 socket: ::ffff: followed by the IPv4 address, for example ::ffff:192.168.1.1. It is the same 32 bits with a fixed 96-bit prefix.

What is dotted octal?

Each octet is written in base 8 with a leading 0, so 192.168.1.1 becomes 0300.0250.01.01. Many classic parsers accept this, which is why leading zeros in addresses can be dangerous.