IP address converter

Every way the same address can be written. It works in both directions: paste a number and get the address back. Nothing is sent to us.

A number below 4 294 967 296 is read as IPv4, a larger one as IPv6. A prefix after a slash is accepted and ignored: this page is about one address, not a block.

One address, many spellings

An IP address is a number. Everything else — the dots, the colons, the hexadecimal — is notation, and notation is a human convenience that software does not share. 8.8.8.8, 134744072, 0x08080808 and 00001000.00001000.00001000.00001000 are the same 32 bits written four ways. A machine that stores addresses as integers, a firewall that logs them in hex and a spreadsheet that has helpfully turned them into numbers are all talking about the same thing.

That is the whole purpose of this page: take whatever form you have and show every other form, in both directions. Paste an address and get the number; paste the number and get the address back. The page never sends anything anywhere — the conversion happens in JavaScript in the tab you are looking at.

The forms, and when each one turns up

Decimal
The address as a single integer. This is what databases store when a column is INT UNSIGNED rather than a string, because integers compare and sort correctly while strings put 10.0.0.2 after 10.0.0.10. It is also what inet_aton() and its equivalents return. If a log or an export has given you a bare nine- or ten-digit number where an address should be, this is why.
Hexadecimal
Two hex digits per octet for IPv4, thirty-two digits for IPv6. Packet dumps, kernel messages and /proc/net/tcp on Linux all speak hex — and /proc/net/tcp writes it byte-reversed on little-endian machines, which is a well-known way to lose an hour.
Binary
The form worth looking at exactly once, when subnetting stops making sense. Seeing where a /26 boundary falls inside the third octet turns prefix arithmetic from a memorised table into something obvious.
Octal
Shown here as a warning rather than a convenience — see the section below.
IPv6 expanded and compressed
The same IPv6 address written in full (2001:0db8:0000:0000:0000:0000:0000:0001) and canonically (2001:db8::1). The compressed form follows RFC 5952: lowercase, no leading zeros, and :: replacing the longest run of zero groups. Software that compares addresses as text rather than as numbers will treat those two strings as different, which is why access lists and allow-lists should be built from parsed addresses, never from string equality.
IPv4-mapped IPv6
::ffff:8.8.8.8. A socket opened as IPv6 but talking to an IPv4 peer reports the remote address in this form, which is why an IPv4 address suddenly appears in your logs wearing colons. If your allow-list only matches dotted quads, it will not match this — a genuine and common source of "the rule works locally and not in production".
6to4 prefix
The 2002::/16 block that embeds an IPv4 address in bits 16–47. The transition mechanism itself was deprecated in 2015 and the public relays are gone, but the notation survives in old configurations and in traffic from hosts nobody has revisited.
Reverse DNS zone
The name a PTR record actually lives at: 8.8.8.8.in-addr.arpa for IPv4, and for IPv6 thirty-two nibbles in reverse order under ip6.arpa. Writing that IPv6 name by hand is how zone files acquire typos, and the typo does not produce an error — it produces a lookup that silently returns nothing.

Why the octal form is on this page at all

A leading zero in an octet is not decoration. The classic C function inet_aton() — and everything historically built on it, which includes a great deal of still-running software — reads an octet beginning with 0 as an octal number. Under that rule 010.1.1.1 is 8.1.1.1. Modern parsers, including Python's ipaddress module and Go's net/netip, reject the leading zero outright instead. A third group accepts it and reads it as decimal.

So the same string can mean two different addresses, or no address at all, depending on which library sees it. That is not a curiosity; it is a security primitive. If a validator reads 010.1.1.1 as "10.1.1.1, that's fine" and the HTTP client that runs afterwards reads it as 8.1.1.1, the check and the connection have gone to different places — which is precisely the shape of a server-side request forgery bypass. The same trick appears in blocklist evasion, where an entry is written in a form the blocklist does not recognise but the resolver does.

We show you the octal form so that you recognise it when you meet it, and we read a leading zero as decimal while saying so out loud. The practical rule is short: never write a leading zero in an address, and when validating addresses from outside, parse them into a number and compare numbers — never compare the strings.

Reading a number back into an address

Paste a bare integer and the page converts in the other direction. Numbers below 4 294 967 296 are read as IPv4, because that is what someone typing a number into an IP converter almost always means; anything larger is read as IPv6. A 0x prefix is understood, and so is a string of exactly 32 or 128 binary digits.

The ambiguity is real and we would rather name it than hide it: 1 is 0.0.0.1 under the IPv4 reading and ::1 under the IPv6 one. Both are legitimate; the page picks IPv4 and tells you so under the field, instead of guessing quietly and letting you find out later.

Nothing here reaches us

The whole conversion runs in your browser. There is no form that submits, no request in the background and no entry in our logs — we do not know which addresses you looked at. If you would rather verify that than take our word for it: load the page, disconnect the network, and keep using it.

Frequently asked questions

How do I convert an IP address to a decimal number?

Multiply out the octets: the first is worth 16777216, the second 65536, the third 256 and the last 1, so 8.8.8.8 is 134744072. Paste the address above and the decimal form appears without the arithmetic. The reason anyone needs it is storage and sorting — a database column holding addresses as integers compares them correctly, while a text column puts 10.0.0.10 before 10.0.0.2.

Can I convert a decimal number back into an IP address?

Yes, paste the number instead of an address. Anything below 4294967296 is read as IPv4 and anything larger as IPv6, because someone typing a number into an IP converter is nearly always coming from IPv4. Hexadecimal with a 0x prefix and a string of exactly 32 or 128 binary digits are understood too.

Why does 010.1.1.1 not mean 10.1.1.1 everywhere?

Because a leading zero marks an octal number in the classic inet_aton() parser and everything built on it, so 010 is 8 and the address becomes 8.1.1.1. Other libraries reject the leading zero outright, and a third group reads it as decimal. The same string therefore means different addresses in different software, which is exactly how filters get bypassed — never write a leading zero in an address, and validate addresses by parsing them into numbers rather than comparing strings.

What is ::ffff:8.8.8.8 and why is it in my logs?

It is the IPv4-mapped IPv6 form. A socket opened as IPv6 that accepts a connection from an IPv4 client reports the peer in this notation, so an IPv4 address arrives wearing colons. It matters because an allow-list that matches only dotted quads will not match this form, which is a common reason a rule works in testing and silently fails in production.

Why do the expanded and compressed IPv6 forms both matter?

They are the same address, but not the same string, and software that compares addresses as text will treat 2001:0db8::0001 and 2001:db8::1 as different. The compressed form follows RFC 5952 — lowercase, no leading zeros, and :: replacing the longest run of zero groups — so it is the one to store and to publish. Comparisons should still be done on parsed addresses, never on the text.

What is the reverse DNS zone name for?

It is where a PTR record actually lives: 8.8.8.8.in-addr.arpa for IPv4, and for IPv6 the thirty-two nibbles of the address in reverse order under ip6.arpa. You need it when adding or debugging reverse records in a zone file. Writing the IPv6 form by hand is a reliable way to introduce a typo, and the failure is silent — the lookup simply returns nothing rather than reporting an error.

Is the 6to4 prefix still useful?

Not for building anything. The transition mechanism was deprecated in 2015 and the public relays have been switched off, so traffic through it does not work reliably any more. The notation is shown because it still appears in old configuration files and in traffic from hosts that nobody has revisited, and being able to read 2002:0808:0808::/48 as "this is 8.8.8.8 wearing an IPv6 costume" saves confusion.

Do the addresses I paste here reach your server?

No. The conversion is JavaScript running in your browser, so nothing is submitted and nothing appears in our logs — we do not know which addresses you converted. The page keeps working with the network disconnected, which is a straightforward way to check the claim yourself rather than trusting it.

Related checks