LDAP Filter Tester

100% Client-Side
Privacy: 100% Client-Side. Your data never leaves this browser tab. Processing uses Web APIs and client-side libraries only.

Validate and pretty-print RFC 4515 LDAP search filters, escape values against LDAP injection, and test filters against a sample entry — 100% in-browser.

Validate and pretty-print LDAP search filters (RFC 4515), escape values to prevent LDAP injection, and test a filter against a sample entry. Nothing is sent to a directory server.

  • Warn(mail=*…) starts with a wildcard, which usually can't use an index and is slow on large directories.
(&
  (objectClass=person)
  (|
    (mail=*@example.com)
    (uid=alice*)
  )
  (!
    (userAccountControl:1.2.840.113556.1.4.803:=2)
  )
)
JSON

Matches

Matching is case-insensitive (caseIgnoreMatch), with numeric ordering for numbers and the bitwise AND / OR rules (…1.4.803 / …1.4.804).

(uid=\2a\29\28uid=\2a\29\29\28|\28uid=\2a)
  • FailThe value contains * ) (; without escaping it changes the filter's meaning (LDAP injection). Escaped: \2a\29\28uid=\2a\29\29\28|\28uid=\2a

What is an LDAP search filter?

LDAP directories are searched with filters such as (&(objectClass=person)(mail=*@example.com)). RFC 4515 defines the syntax: & | ! for logic, =, ~=, >= and <= comparisons, * wildcards, and extensible matches with matching rules.

Special characters in values must be escaped as \2a, \28, \29 and \5c. Building filters from unescaped user input lets an attacker change the query (LDAP injection), which this tool helps catch.

How to use this tool

  1. Paste a filter to validate it and see it indented.
  2. Edit the JSON entry to check whether the filter would match it.
  3. Type a user-supplied value to see it escaped and whether it would have injected.

Frequently asked questions

Does this query a directory?

No. Everything runs in your browser; no LDAP server is contacted.

How is matching done?

Case-insensitively, like caseIgnoreMatch, with numeric ordering for numbers. caseExactMatch and the bitwise AND / OR rules used for flag attributes are supported; unknown rules evaluate to Undefined.

Which characters must be escaped?

*, (, ), \ and NUL, as \2a, \28, \29, \5c and \00 (RFC 4515 §3).