# INET\_ATON

Converts an IPv4 address to a 32-bit integer.

## Syntax

```sql
INET_ATON ( ip )

```

## Arguments

* ip: a dotted-quad IP address, eg “1.2.3.4”

## Return Type

Integer, or NULL if the IP address cannot be parsed.

> **📝 Note**: This function does not handle IPv6 addresses.

## Examples

```sql
SELECT INET_ATON('1.2.3.4');

```

```output

+----------------------+
| INET_ATON('1.2.3.4') |
+----------------------+
|             16909060 |
+----------------------+

```

```sql
SELECT INET_ATON('127.1');

```

```output

+--------------------+
| INET_ATON('127.1') |
+--------------------+
|         2130706433 |
+--------------------+
```

```sql
SELECT INET_ATON('127.0.0.1');

```

```output

+------------------------+
| INET_ATON('127.0.0.1') |
+------------------------+
|             2130706433 |
+------------------------+
```

```sql
SELECT INET_ATON('2a03:2880:10:1f02:face:b00c::25');

```

```output

+----------------------------------------------+
| INET_ATON('2a03:2880:10:1f02:face:b00c::25') |
+----------------------------------------------+
|                                         NULL |
+----------------------------------------------+
```

## Related Topics

* [INET\_NTOA](https://docs.singlestore.com/db/v9.1/reference/sql-reference/string-functions/inet-ntoa.md)

***

Modified at: April 4, 2023

Source: [/db/v9.1/reference/sql-reference/string-functions/inet-aton/](https://docs.singlestore.com/db/v9.1/reference/sql-reference/string-functions/inet-aton/)

(An index of the documentation is available at /llms.txt)
