---
name: "strtoumax"
section: "3"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/strtoimax"
---

# strtoumax(3)

string to \[u\]intmax\_t

Part of [strtoimax(3)](/strtoimax/3.md).

## NAME

strtoimax, strtoumax - string to \[u\]intmax\_t

## LIBRARY

Standard C library (*libc*, *-lc*)

## SYNOPSIS

```
#include <inttypes.h>
```

**intmax\_t strtoimax(const char \*restrict** *nptr***, char \*\*restrict** *endptr***,**                    **int** *base***);** **uintmax\_t strtoumax(const char \*restrict** *nptr***, char \*\*restrict** *endptr***,**                    **int** *base***);**

## DESCRIPTION

These functions are just like [**strtol**(3)](/strtol/3.md) and [**strtoul**(3)](/strtoul/3.md), except that they return a value of type *intmax\_t* and *uintmax\_t*, respectively.

## RETURN VALUE

On success, the converted value is returned. If nothing was found to convert, zero is returned. On overflow or underflow **INTMAX\_MAX** or **INTMAX\_MIN** or **UINTMAX\_MAX** is returned, and *errno* is set to **ERANGE**.

## ATTRIBUTES

For an explanation of the terms used in this section, see [**attributes**(7)](/attributes/7.md).

| | | |
| --- | --- | --- |
| **Interface** | **Attribute** | **Value** |
| **strtoimax**(), **strtoumax**() | Thread safety | MT-Safe locale |

## STANDARDS

C11, POSIX.1-2008.

## HISTORY

POSIX.1-2001, C99.

## SEE ALSO

[**imaxabs**(3)](/imaxabs/3.md), [**imaxdiv**(3)](/imaxdiv/3.md), [**strtol**(3)](/strtol/3.md), [**strtoul**(3)](/strtoul/3.md), [**wcstoimax**(3)](/wcstoimax/3.md)
