---
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: 7.3
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: 2023-05-16T09:40:41Z
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:

```bash
$ 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

# 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
```
