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

# strcoll(3)

strings LC\_COLLATE compare

## NAME

strcoll - strings LC\_COLLATE compare

## LIBRARY

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

## SYNOPSIS

```
#include <string.h>
```

**int strcoll(const char \****s1***, const char \****s2***);**

## DESCRIPTION

The **strcoll**() function compares the two strings *s1* and *s2*. It returns an integer less than, equal to, or greater than zero if *s1* is found, respectively, to be less than, to match, or be greater than *s2*. The comparison is based on strings interpreted as appropriate for the program's current locale for category **LC\_COLLATE**. (See [**setlocale**(3)](/setlocale/3.md).)

## RETURN VALUE

The **strcoll**() function returns an integer less than, equal to, or greater than zero if *s1* is found, respectively, to be less than, to match, or be greater than *s2*, when both are interpreted as appropriate for the current locale.

## ATTRIBUTES

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

| | | |
| --- | --- | --- |
| **Interface** | **Attribute** | **Value** |
| **strcoll**() | Thread safety | MT-Safe locale |

## STANDARDS

C11, POSIX.1-2008.

## HISTORY

POSIX.1-2001, C89, SVr4, 4.3BSD.

## NOTES

In the *POSIX* or *C* locales **strcoll**() is equivalent to [**strcmp**(3)](/strcmp/3.md).

## SEE ALSO

[**memcmp**(3)](/memcmp/3.md), [**setlocale**(3)](/setlocale/3.md), [**strcmp**(3)](/strcmp/3.md), [**string**(3)](/string/3.md), [**strxfrm**(3)](/strxfrm/3.md)
