# IPv4 to Integer

Convert IPv4 addresses to integers. Supports batch conversion of multiple addresses.

> Canonical page: https://elysiatools.com/en/tools/ipv4-to-integer

- **Category:** Network

- **Keywords:** ipv4, integer, converter, network, ip address, decimal, batch

## Overview

The IPv4 to Integer converter allows you to quickly transform standard dot-decimal IP addresses into their corresponding 32-bit integer values. Designed for network administrators and developers, this tool supports batch processing, enabling you to convert multiple IP addresses simultaneously for database storage, network programming, or data analysis tasks.

## Inputs

- **IPv4 Addresses** (textarea): Enter IPv4 addresses, one per line: 192.168.1.1 10.0.0.1 172.16.0.1 127.0.0.1 8.8.8.8
- **Include Binary** (checkbox): Show 32-bit binary representation
- **Include Hexadecimal** (checkbox): Show hexadecimal representation
- **Sort by Integer Value** (checkbox): Sort results by integer value (ascending)
- **Add Line Numbers** (checkbox): Number each conversion result
- **Show Source Data** (checkbox): Display original IPv4 addresses in results

## When to use

- When you need to store IP addresses in a database as integers for optimized indexing and faster range queries.
- When performing network programming tasks that require converting IP strings into numerical formats for bitwise operations.
- When you need to sort or compare large lists of IP addresses by their numerical value rather than their string representation.

## How it works

- Enter your IPv4 addresses into the input area, placing each address on a new line.
- Select optional output formats such as binary or hexadecimal to view the address in different numerical bases.
- Enable sorting or line numbering if you need to organize your results before copying them for use in your project.
- Click the convert button to generate the integer representations instantly.

## Use cases

- Database optimization for network security logs and traffic monitoring systems.
- Simplifying IP range validation logic in application code.
- Generating ordered lists of IP addresses for network configuration files.

## Frequently asked questions

### What is the formula for converting IPv4 to an integer?

An IPv4 address is split into four octets (A.B.C.D). The integer is calculated as (A * 256^3) + (B * 256^2) + (C * 256^1) + D.

### Can I convert multiple IP addresses at once?

Yes, the tool supports batch processing. Simply paste your list of IP addresses, one per line, and the tool will convert all of them in a single operation.

### Why would I store an IP address as an integer?

Storing IPs as integers is more storage-efficient and significantly faster for database operations, such as checking if an IP falls within a specific subnet range.

### Does this tool support IPv6 addresses?

No, this tool is specifically designed for IPv4 addresses. IPv6 addresses require a different conversion method due to their 128-bit length.

### Can I see the binary or hex representation of the IP?

Yes, you can enable the 'Include Binary' or 'Include Hexadecimal' options to display these formats alongside the integer value.

## Related tools

- [Integer to IPv4](https://elysiatools.com/en/tools/integer-to-ipv4): Convert integers to IPv4 addresses. Supports batch conversion of multiple integers.
- [Integer to IPv6](https://elysiatools.com/en/tools/integer-to-ipv6): Convert integers (128-bit) to IPv6 addresses. Supports batch conversion.
- [IPv4 to IPv6](https://elysiatools.com/en/tools/ipv4-to-ipv6): Convert IPv4 addresses to IPv6 addresses. Supports IPv4-mapped and IPv4-compatible formats.
- [IPv6 to Integer](https://elysiatools.com/en/tools/ipv6-to-integer): Convert IPv6 addresses to integers (128-bit). Supports batch conversion.
- [MAC OUI Vendor Lookup](https://elysiatools.com/en/tools/mac-oui-vendor-lookup): Look up the manufacturer of a MAC address from the IEEE OUI database, or reverse-search a company name to list all its OUI blocks — fully offline
- [CIDR Calculator](https://elysiatools.com/en/tools/cidr-calculator): Calculate network information from CIDR notation. Supports IPv4 and IPv6.
- [IP Geolocation](https://elysiatools.com/en/tools/ip-geolocation): Visualize the geographic location, network (ASN/ISP), timezone, and security posture of any IP address as a rich card report
- [DNSSEC Chain & RDAP Trust Auditor](https://elysiatools.com/en/tools/whois-rdap-dnssec-chain-validator-and-iana-bootstrap-trust-auditor): Audit a domain end to end: IANA RDAP bootstrap referral, registry/registrar WHOIS data, and the DNSSEC chain of trust from the root KSK through the TLD DS to the apex DNSKEY — with DS digest verification and RRSIG expiry flags.

## Samples

- [Web Image Processing Python Samples](https://elysiatools.com/en/samples/web-image-processing-python): Web Python image processing examples using PIL/Pillow including reading, saving, resizing, and format conversion
- [Android Image Processing Java Samples](https://elysiatools.com/en/samples/android-image-processing-java): Android Java image processing examples including reading/saving images, scaling, and format conversion
- [Android Image Processing Kotlin Samples](https://elysiatools.com/en/samples/android-image-processing-kotlin): Android Kotlin image processing examples including reading/saving images, scaling, and format conversion
- [Web Image Processing Rust Samples](https://elysiatools.com/en/samples/web-image-processing-rust): Web Rust image processing examples including image read/save, scaling, and format conversion

## Related content

- [Network Triage, Packet Inspection, and Endpoint Debugging](https://elysiatools.com/en/hubs/network-triage-debugging): Inspect captures, replay webhooks, validate addresses and CIDR ranges, check DNS, WHOIS, hosts files, TLS, and user agents, then record a focused network diagnosis.
- [Network Address Conversion and Evidence Preparation](https://elysiatools.com/en/hubs/network-convert): Validate addresses, convert IPv4 and IPv6 formats, normalize URL and webhook inputs, and package DNS, hosts, port, WHOIS, and packet evidence for review.
