Home › Developer Tools › IP Address Converter

IP Address Converter

Paste an IPv4 address or a number in any common format and get every representation at once: dotted decimal, 32-bit integer, hex, binary, octal and IPv4-mapped IPv6. The tool also tells you the address class and whether it is private, public, loopback, multicast or reserved.

Last updated:

Accepts dotted decimal, decimal integer, hex, binary, octal or ::ffff: IPv4-mapped IPv6.

Enter your values to see the result.
Advertisement
Advertisement

How to use the IP Address Converter

  1. Type or paste an IPv4 address (192.168.1.1) or a number such as 3232235777, 0xC0A80101 or a binary string.
  2. Leave the format on Auto-detect, or choose it explicitly if your input is ambiguous (for example dotted octal).
  3. Click Convert (results also update as you type).
  4. Read the conversions, class and address type, and check the step-by-step working.
  5. Copy the results or download the octet table as CSV.

IPv4 conversion formulas

An IPv4 address is a single 32-bit number written as four 8-bit octets. The dotted form a.b.c.d and the integer are the same value:

ConversionFormulaExample (192.168.1.1)
Dotted → integera × 256³ + b × 256² + c × 256 + d3232235777
Integer → dotted⌊n ÷ 256³⌋ mod 256, ⌊n ÷ 256²⌋ mod 256, ⌊n ÷ 256⌋ mod 256, n mod 256192.168.1.1
Hexeach octet as two hex digits0xC0A80101
Binaryeach octet as eight bits11000000.10101000.00000001.00000001
Octalinteger in base 8 (leading 0)030052000401
IPv4-mapped IPv6::ffff: + the IPv4 address::ffff:192.168.1.1 = ::ffff:c0a8:101

Special IPv4 ranges

RangeInteger rangePurpose
0.0.0.0/80 – 16,777,215"This network", not routable
10.0.0.0/8167,772,160 – 184,549,375Private (RFC 1918)
100.64.0.0/101,681,915,904 – 1,686,110,207Carrier-grade NAT (RFC 6598)
127.0.0.0/82,130,706,432 – 2,147,483,647Loopback
169.254.0.0/162,851,995,648 – 2,852,061,183Link-local (APIPA)
172.16.0.0/122,886,729,728 – 2,887,778,303Private (RFC 1918)
192.168.0.0/163,232,235,520 – 3,232,301,055Private (RFC 1918)
192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24—Documentation examples (TEST-NET)
224.0.0.0/43,758,096,384 – 4,026,531,839Multicast (Class D)
240.0.0.0/44,026,531,840 – 4,294,967,295Reserved (Class E) incl. 255.255.255.255 broadcast

Storing addresses as integers is handy in databases: range checks such as "is this IP inside 10.0.0.0/8" become a simple BETWEEN comparison.

Frequently asked questions

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

Multiply each octet by its place value and add them up: integer = a × 16,777,216 + b × 65,536 + c × 256 + d. For 192.168.1.1 that is 3,221,225,472 + 11,010,048 + 256 + 1 = 3,232,235,777.

How do I convert a decimal integer back to an IP address?

Divide repeatedly by 256: a = floor(n ÷ 16,777,216) mod 256, b = floor(n ÷ 65,536) mod 256, c = floor(n ÷ 256) mod 256 and d = n mod 256. Valid values run from 0 (0.0.0.0) to 4,294,967,295 (255.255.255.255).

Which IP addresses are private?

RFC 1918 reserves 10.0.0.0/8, 172.16.0.0/12 (172.16.0.0 to 172.31.255.255) and 192.168.0.0/16 for private networks. 100.64.0.0/10 is shared space used by carrier-grade NAT, 127.0.0.0/8 is loopback and 169.254.0.0/16 is link-local; none of these are routed on the public internet.

How are IP address classes determined?

Classful addressing looks at the first octet: 0-127 is Class A, 128-191 Class B, 192-223 Class C, 224-239 Class D (multicast) and 240-255 Class E (reserved). Modern networks use CIDR instead, but classes are still taught and used as shorthand.

What is an IPv4-mapped IPv6 address?

It is the IPv6 form ::ffff:a.b.c.d that dual-stack software uses to represent an IPv4 address, for example ::ffff:192.168.1.1, which can also be written ::ffff:c0a8:101.

Why can a leading zero change the address?

Some tools, including the classic inet_aton function and ping on many systems, read an octet with a leading 0 as octal, so 010.0.0.1 may become 8.0.0.1. This converter reads dotted input as decimal by default and warns you; choose the octal format if you meant octal.

Is my data sent anywhere?

No. All conversions run in your browser with JavaScript; nothing you type is uploaded.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

Subnet CalculatorCalculate IPv4 network, broadcast, host range, masks and host count, and split subnets.IPv4 to IPv6 ConverterConvert IPv4 to IPv4-mapped, 6to4 and NAT64 IPv6, extract IPv4 from IPv6, and get int/hex/binary.Number Base ConverterConvert numbers between any bases from 2 to 36, with fractions and steps.What Is My IPSee your public IP address and location.ASN LookupLook up an AS number or IP: network owner, country, registry, abuse contact and announced prefixes.IP Range to CIDRTurn a start and end IP into the shortest list of CIDR blocks, for IPv4 and IPv6.JSON to Excel ConverterTurn JSON into a styled .xlsx spreadsheet; nested arrays become their own linked sheets.JSON to CSVConvert JSON data to CSV for spreadsheets.CSV to JSONConvert CSV data to JSON with live preview.Excel to CSVConvert XLSX spreadsheets to CSV.CSV ViewerOpen a CSV or TSV file as a sortable, filterable table.Excel Viewer (XLSX / XLS)Open XLSX, XLS and ODS spreadsheets in your browser without Excel.Line Ending ConverterConvert text and files between CRLF, LF and CR line endings.Markdown to HTMLConvert Markdown to clean HTML with a live editor.XML to JSONConvert XML to JSON with validation.Text Encoding ConverterDetect and convert text file encodings like UTF-8, UTF-16 and Latin-1.JSON ViewerExplore JSON as a collapsible tree, search keys and values and copy any node's path.TTF to WOFF2 ConverterConvert TTF and OTF fonts to WOFF2 or WOFF and get a ready @font-face CSS snippet.Chmod CalculatorConvert Linux file permissions between checkboxes, octal (755) and symbolic (rwxr-xr-x) notation.JSON to TypeScriptGenerate TypeScript interfaces or types from JSON, with nested types and optional fields.Morse Code TranslatorTranslate text to Morse code and back, then play it as sound or a blinking light, or save a WAV.HTML Table GeneratorBuild HTML tables in an editable grid with styles, header rows, CSV import and live preview.Hex to Text ConverterConvert hex to text and text to hex with UTF-8 support and space, 0x, \x or comma formats.JSON to XML ConverterConvert JSON to well-formed XML with attributes, arrays and pretty print.JSON to YAML ConverterConvert JSON to clean YAML as you type, with indent, quoting and sort options.YAML to JSON ConverterConvert YAML to pretty or minified JSON, with errors pinned to the exact line.HTML to Markdown ConverterTurn HTML or pasted rich text into clean Markdown with tables and live preview.Markdown Table GeneratorBuild Markdown tables in a grid or paste from Excel/CSV, with alignment and preview.JSON ValidatorCheck JSON with the exact line and column of each error, fix tips and one-click auto-fix.Image to Base64Convert images to Base64 data URIs, CSS backgrounds and HTML img tags in your browser.Base64 to ImagePaste a Base64 string or data URI to preview, identify and download the image.JSON CompareCompare two JSON documents and see every added, removed and changed path.Hex to DecimalConvert hex to decimal instantly with steps and signed mode.Decimal to HexConvert decimal to hex instantly with steps and signed mode.Binary to DecimalConvert binary to decimal instantly with steps and signed mode.Decimal to BinaryConvert decimal to binary instantly with steps and signed mode.Two's Complement CalculatorDecimal to two's complement binary and back for 4-64 bits, with invert-and-add-1 steps.XML to CSV ConverterConvert XML to CSV: detects repeating records, flattens nested data, pick your columns.cURL to Code ConverterConvert curl commands to JavaScript fetch, Axios, Python requests, Node.js, PHP and Go code.Code to ImageTurn code into a beautiful syntax-highlighted PNG with themes, window frame and background.Excel to JSON ConverterConvert Excel sheets (XLSX, XLS, ODS) to JSON with header row, type and shape options.CSV to Excel ConverterConvert CSV files to a real .xlsx workbook with typed numbers and dates, one sheet per file.CSV SplitterSplit a large CSV into smaller files by row count, file count or column value, header kept.CSV MergerCombine many CSV files into one, matching columns by name, with dedupe and a source column.VCF to CSV ConverterConvert vCard (.vcf) contacts to CSV for Google or Outlook, or turn a CSV back into a VCF.Calendar Event (.ics) GeneratorCreate an .ics calendar invite with time zone, reminders and repeats + Google/Outlook links.CSV Column ExtractorPick, reorder and rename CSV columns, filter rows by value, and export a new CSV or JSON.CSV Diff CheckerCompare two CSV files by key column and see added, removed and changed rows cell by cell.CSV Duplicate Row RemoverRemove duplicate rows from a CSV by all or selected columns and download the cleaned file.CSV to HTML TableTurn CSV into clean HTML table code with a live preview, styling options and one-click copy.CSV to Markdown TableConvert CSV to a neatly aligned GitHub Markdown table with column alignment and live preview.CSV TransposeSwap rows and columns of CSV, TSV or pasted spreadsheet data, with delimiter auto-detect.Date Format ConverterConvert any date to ISO 8601, RFC 2822, Unix time and custom strftime, moment or Java patterns.ENV to JSON ConverterConvert .env files to JSON or YAML and JSON back to .env, with quotes and multiline values.File to Base64Convert any file to a Base64 string or data URI with MIME detection, line wrap and download.HTML Table to CSVExtract any table from HTML or page source to CSV, TSV or JSON, with colspan and rowspan handled.IEEE 754 Floating Point ConverterConvert decimals to 32/64-bit IEEE 754 floats: toggle bits, see hex, exact value and rounding error.INI to JSON ConverterConvert INI and CFG files to JSON and JSON back to INI, with sections, arrays and types.ISBN Converter & ValidatorConvert ISBN-10 to ISBN-13 and back, validate check digits and hyphenate, one or in bulk.JSON Flatten / UnflattenFlatten nested JSON to dot or bracket path keys, or unflatten flat keys back to nested JSON.JSON to Dart ClassTurn JSON into Dart model classes with fromJson, toJson, null safety and nested classes.JSON to Java ClassTurn JSON into Java POJOs or records with Lombok, getters/setters and Jackson or Gson annotations.JSON to Kotlin Data ClassTurn JSON into Kotlin data classes for kotlinx.serialization, Gson, Moshi or Jackson.JSON to Markdown TableTurn a JSON array of objects into a GitHub Markdown table with column picker and alignment.JSON to PHP ArrayConvert JSON to PHP array code (short [] or array()) and PHP arrays back to JSON.JSON to Rust StructTurn JSON into Rust structs with serde derives, rename attributes, Option and Vec types.JSON to SQL ConverterConvert a JSON array of objects to CREATE TABLE and INSERT statements for MySQL, Postgres, SQLite.JSON to Swift StructTurn JSON into Swift Codable structs with CodingKeys, optionals and nested types.
See all 129 Data & File Format Converters →