What is an LDIF File?

How to Open, Edit, & Convert LDIF Files

LDIF Files
LDIF Files.

A file with the LDIF file extension is an LDAP Data Interchange Format file used by Lightweight Directory Access Protocol (LDAP) directories. An example use for a directory may be to store information for the purpose of authenticating users, such as the accounts associated with banks, email servers, ISPs, etc.

LDIF files are just plain text files that represent LDAP data and commands. They provide a simple way to communicate with a directory so as to read, write, rename, and delete entries, similar to how REG files can be used to manipulate the Windows Registry.

Inside an LDIF file are separate records, or lines of text that correspond to an LDAP directory and the items inside it. They're created by either exporting data from an LDAP server or building the file from scratch, and typically include a name, ID, object class, and various attributes (see the example below).

Some LDIF files are just used to store address book information for email clients or record keeping applications.

How To Open an LDIF File

LDIF files can be opened for free with Microsoft's Active Directory Explorer and JXplorer. Although it's not free, another program that should support LDIF files is Softerra's LDAP Administrator.

Windows 2000 Server and Windows Server 2003 have built-in support for importing and exporting LDIF files into Active Directory through the a command-line tool called ldifde.

Since LDIF files are just plain text files, you can also open and edit one with Notepad++.

Below is an example of what one looks like when opened in a text editor. The purpose for this particular LDIF file is to add a phone number to the entry that corresponds with this user.

 dn: cn=John Doe, ou=Artists, l=San Francisco, c=US
 changetype: modify
 add: telephonenumber
 telephonenumber: +1 415 555 0002

Tip: ZyTrax is a good resource that explains what these and other LDAP abbreviations mean.

The LDIF file extension is also used to store address book data. If that's what your LDIF file contains, then you can open it with those types of applications, like Mozilla Thunderbird or Apple's Address Book.

Note: If you still can't open your file, you might be misreading the extension and confusing it with files that have a similar suffix, like a DIFF, LDB (Microsoft Access Lock), or LDM (VolumeViz Multi-Resolution Volume) file.

While I doubt this would happen in this case, it's possible that more than one program you have installed supports LDIF files but the one that's set as the default program isn't the one you'd like to use. If you find this to be the case, see How to Change File Associations in Windows for steps on how to change it.

How To Convert an LDIF File

NexForm Lite should be able to convert LDIF to CSV, XML, text, and other text-based formats, as well as convert other formats into the LDIF format.

Another tool, ldiftocsv, can also convert LDIF files to CSV.

If you're using a program like Mozilla Thunderbird, you can export your address book to the CSV format without having to convert the LDIF file, by just using the CSV option in the Tools > Export menu instead of LDIF.