Skip to content
LegacyFile
← Learn

How to Convert LDIF to CSV (Free, In Your Browser)

By LegacyFile ·

You exported users from Active Directory with ldifde, dumped a directory tree with ldapsearch, or were handed an .ldif file by whoever is decommissioning the old identity server. Now HR wants the user list in Excel, an auditor wants group memberships in a spreadsheet, or you need a CSV to feed the new system's import tool. Here's the fastest way to get there, and what to watch out for along the way.

Why you can't just rename .ldif to .csv

An LDIF file isn't delimited data — it's a sequence of entry blocks, each starting with a dn: line and holding one attribute: value line per value. Renaming the extension to .csv and opening it in Excel dumps that raw syntax into a single column. And the format has real parsing work hiding in it: values with accents arrive base64-encoded after a double colon (cn:: Sm9zw6kgR2FyY8OtYQ==), long lines wrap onto continuation lines that start with a single space, one user can have any number of memberOf lines, and some blocks aren't data at all — they're changetype: modify instructions. You need something that actually understands RFC 2849. For background on what's inside the file, see What is an LDIF file?

A note on Active Directory specifically: ldifde exports LDIF, but its sibling csvde exports CSV directly. If you still have access to the domain controller, csvde -f export.csv is an option — but if all you have is the .ldif file, converting it is faster than re-running an export you may not have permissions for anymore.

Convert LDIF to CSV in your browser

The free LDIF to CSV converter on LegacyFile handles the whole format, including the parts that trip up naive converters:

  1. Drop your .ldif or .ldf file into the converter. Parsing happens entirely on your device — your directory data is never uploaded anywhere, which matters when the file is a complete list of your organization's user accounts.
  2. It unfolds wrapped lines. LDIF caps line length, so long values — a full memberOf DN, for instance — wrap across physical lines that need rejoining before they mean anything.
  3. It decodes base64 values as UTF-8. Any value with accented or non-Latin characters is base64-encoded in the file (displayName:: Sm9zw6k...). The converter decodes it back to readable text like José, and the summary tells you how many values it decoded.
  4. It joins multi-valued attributes into one readable cell. A user in five groups gets one memberOf cell with all five group DNs joined by ; instead of losing four of them.
  5. It skips change records — and tells you. Blocks marked changetype: modify, delete, or modrdn are edit instructions, not entries, so they can't be rows. changetype: add records carry full objects and are kept. The summary shows the skipped count.
  6. Check the summary, preview every entry, then export CSV, XLSX, or JSON. The CSV opens directly in Excel or Google Sheets, and most import tools take it as-is.

What ends up in each column

Unlike a fixed-schema format, LDIF entries carry whatever attributes each object happens to have — so the converter builds columns from your actual file: dn always comes first, then the union of every attribute name across all entries, in the order each first appears. An entry that lacks an attribute just gets an empty cell in that column. Attribute options like displayName;lang-en are stripped to the base name (displayName) so language-tagged variants land in the same column, and attr:< file:///... URL references keep the URL text with a warning rather than pretending to inline a file the converter can't see.

When something looks off

The converter never fails silently. A line with no colon, a base64 value that won't decode, a block that doesn't start with dn: — each one is flagged in the warnings list while the rest of the file converts anyway. That's the safest default when you're working from an export you can't easily re-run. The one hard stop is a file with no dn: lines at all, which usually means the file isn't LDIF in the first place — a csvde export, for example, is already CSV.

Common variations you might have

  • .ldf files are just LDIF with Active Directory's preferred extension — drop them in as-is.
  • ldapsearch output often starts with # comment lines describing the search; those are skipped automatically.
  • Change files (the input you'd feed ldapmodify) convert too — you'll get the changetype: add entries as rows and a count of the skipped patches.

That's it: drop the file, sanity-check the summary, export. No OpenLDAP tools, no PowerShell, no directory access required.