---
title: LDAP compare
description: The LDAP compare operation checks whether an attribute value you specify matches the attribute value stored on one or more directory entries.
component: pingds
version: 8.1
page_id: pingds:ldap-guide:compare-ldap
canonical_url: https://docs.pingidentity.com/pingds/8.1/ldap-guide/compare-ldap.html
revdate: 2025-10-22T14:42:39Z
keywords: ["LDAP"]
---

# LDAP compare

The LDAP compare operation checks whether an attribute value you specify matches the attribute value stored on one or more directory entries.

In this example, Kirsten Vaughan uses the `ldapcompare` command to check whether the value matches the value of the `description` attribute:

```console
$ ldapcompare \
 --hostname localhost \
 --port 1636 \
 --useSsl \
 --trustStorePath /path/to/opendj/config/keystore \
 --trustStoreType PKCS12 \
 --trustStorePassword:file /path/to/opendj/config/keystore.pin \
 --bindDN "uid=kvaughan,ou=people,dc=example,dc=com" \
 --bindPassword bribery \
 'description:Description on ou=People' \
 uid=kvaughan,ou=people,dc=example,dc=com
```

> **Collapse: Show output**
>
> ```
> # Comparing type description with value Description on ou=People in entry uid=kvaughan,ou=people,dc=example,dc=com
> # Compare operation returned true for entry uid=kvaughan,ou=people,dc=example,dc=com
> ```
