---
title: LDAP compare
description: Use the LDAP compare operation to check whether a specified attribute value matches a value stored in a PingDS directory entry.
component: pingds
version: 8
page_id: pingds:ldap-guide:compare-ldap
canonical_url: https://docs.pingidentity.com/pingds/8.1/ldap-guide/compare-ldap.html
llms_txt: https://docs.pingidentity.com/pingds/llms.txt
docs_for_agents: https://developer.pingidentity.com/build-with-ai/docs-for-agents.md
revdate: 2024-12-12T14:58:04Z
keywords: ["LDAP"]
superseded_by: https://docs.pingidentity.com/pingds/8.1/ldap-guide/compare-ldap.html
---

# 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 \
 --usePkcs12TrustStore /path/to/opendj/config/keystore \
 --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
> ```
