IPv4 address converter

Decimal, binary, hex, and IPv4-mapped IPv6

All computation runs locally in your browser

Last updated: February 8, 2026
Frank Zhao - Creator
CreatorFrank Zhao

Results

Decimal:
3232235777
Hexadecimal:
C0A80101
Binary:
11000000101010000000000100000001
IPv6:
0000:0000:0000:0000:0000:ffff:c0a8:0101
IPv6 (short):
::ffff:c0a8:0101

Introduction / overview

The IPv4 Address Converter turns a dotted IPv4 address (like 192.168.1.12) into other common representations:

  • Decimal (a single 32-bit number) for databases, sorting, and some APIs

  • Hexadecimal and binary for debugging packets, masks, and bit operations

  • IPv6-mapped form for dual-stack systems and logs

Who is this for?

Developers, SREs, network engineers, and anyone who reads logs or writes allowlists. If you also need subnet boundaries or ranges, pair this tool with our IPv4 subnet calculator and IPv4 range expander.

How to use / quick start

1

Enter an IPv4 address

Type a dotted IPv4 address like 192.168.1.12. The converter validates the format instantly.

2

Copy the representation you need

Use the copy button next to Decimal, Hex, Binary, or IPv6.

3

Share or reset

Share the calculator link (optionally with the current IP), or reset back to the default sample.

Worked example: 192.168.1.12

Decimal conversion uses a base-256 weighting. If the octets are a.b.c.da.b.c.d then:

Decimal=a2563+b2562+c256+d\text{Decimal} = a\cdot 256^3 + b\cdot 256^2 + c\cdot 256 + d
1922563+1682562+1256+12192\cdot 256^3 + 168\cdot 256^2 + 1\cdot 256 + 12==32322357883232235788

The hex form is the same 32-bit value shown in base 1616: C0A8010C. Binary is the same value in base 22.

How to interpret the IPv6 output

The IPv6 fields are IPv4-mapped IPv6 addresses. They look like ::ffff:c0a8:010c and are common in dual-stack logs.

Real-world examples / use cases

Log normalization (storing IPs as numbers)

Background: You want to sort or index IPs in a database efficiently.

Input: 8.8.8.8

82563+82562+8256+88\cdot 256^3 + 8\cdot 256^2 + 8\cdot 256 + 8==134744072134744072

Application: Store 134744072134744072 for faster comparisons, and keep the dotted form for display.

Firewall allowlist checks (hex/binary debugging)

Background: A rule is expressed in hex or you are debugging bitmasks.

Input: 192.168.1.12

Result: Hex C0A8010C and a 32-bit binary string.

Application: Compare rule prefixes quickly, then validate ranges with the IPv4 subnet calculator.

Dual-stack systems (IPv4-mapped IPv6)

Background: Your app logs client addresses as IPv6.

Input: 10.0.0.5

Result: ::ffff:0a00:0005

Application: Recognize it as an IPv4 client, then apply your existing IPv4 allowlist rules.

Sharing exact values during reviews

Background: You and a teammate see the same IP in different formats.

Input: Any IPv4 address

Result: A single page shows all formats with copy buttons.

Application: Share the calculator link with results enabled to eliminate confusion.

Related tool

If you need to convert the decimal output into other bases beyond hex and binary, use our Integer Base Converter.

Common scenarios (when to use)

APIs that accept numeric IPs

Some services accept IPv4 as a 32-bit integer. Convert once, paste safely.

Bit-level debugging

Binary helps when you’re comparing prefixes or understanding masks.

Security reviews

Convert and copy canonical formats to avoid typos in allowlists.

Dual-stack logging

Recognize and generate IPv4-mapped IPv6 addresses used by some stacks.

Ops runbooks

Keep one page with every representation for copy/paste under pressure.

Preparing subnet work

Convert an IP, then jump into subnet/range tools to plan network blocks.

When it may not apply

This converter is for IPv4 dotted addresses. If you have a CIDR block like 192.168.0.0/24, use the IPv4 subnet calculator instead.

Tips & best practices

  • Copy from the results row instead of re-typing (it avoids invisible whitespace and typos).

  • If you compare addresses, compare like-for-like: decimal-to-decimal or hex-to-hex.

  • IPv6-mapped output is for compatibility/logs; it is not the same as a native IPv6 allocation.

  • For subnet planning, convert an IP here, then compute boundaries in the subnet calculator.

  • Share the link with results enabled when you want someone to verify the same exact address.

Calculation method / formulas

An IPv4 address has 4 octets. Each octet is a number in [0,255][0,255]. Treat the address as a base-256 number:

Decimal=a2563+b2562+c256+d\text{Decimal} = a\cdot 256^3 + b\cdot 256^2 + c\cdot 256 + d

Once you have the decimal value, converting to hex or binary is just a base conversion. For example, hex is base 1616, and binary is base 22.

IPv4-mapped IPv6 form puts the IPv4 bytes into the last 32 bits of an IPv6 address, typically with a ::ffff: prefix.

Related concepts / background

Octet: Each dotted part of an IPv4 address. It represents 88 bits.

CIDR: A subnet suffix like /24indicates how many bits are network bits. That’s a subnet topic — use the IPv4 subnet calculator for that.

Frequently asked questions

Why is the decimal value so large?

IPv4 is a 3232-bit number. The maximum is 2321=42949672952^{32}-1 = 4294967295.

Is the hexadecimal output prefixed with 0x?

No — the tool outputs the raw hex digits. If you need a literal, you can prepend 0x yourself.

What is an IPv4-mapped IPv6 address?

It’s an IPv6 address that embeds an IPv4 address in the last 3232 bits, commonly shown as ::ffff:w.x.y.z (in hex groups).

Can I paste a CIDR like 192.168.0.1/24?

This converter expects a plain IPv4 address. For CIDR parsing and subnet outputs, use the IPv4 subnet calculator.

Does this run locally?

Yes — conversions happen in your browser, and copy buttons use your clipboard.

Limitations / disclaimers

  • This tool converts individual IPv4 addresses (not CIDR blocks, not hostnames).

  • IPv6 output here is specifically IPv4-mapped IPv6, meant for compatibility/log reading.

  • Always validate security rules (firewalls/ACLs) in your target platform — formats and reserved ranges can differ.

External references / sources

IPv4 address converter | CalculatorVast