How to alphabetize a hyphenated name depends on the sorting system you use, but the safest general rule is to treat the hyphenated surname as one connected name and alphabetize it by the first element before the hyphen. As an example, Smith-Jones is filed under S, not J. If two names begin the same way, such as Smith-Jones and Smith-King, compare the letters after the shared part until you find the first difference Took long enough..
Introduction: Why Hyphenated Names Need Care
Hyphenated names are common in classrooms, workplaces, libraries, directories, guest lists, bibliographies, and official records. Because the hyphen connects two name parts, it can be tempting to treat each part separately. They may appear as surnames, such as Garcia-Lopez, or as given names, such as Jean-Luc or Mary-Anne. Even so, doing so often creates confusion.
The key idea is simple: a hyphenated name is usually sorted as a single unit, beginning with the first letter of the name part that determines the order. In most surname-based lists, that means you alphabetize by the first element of the hyphenated last name Worth keeping that in mind..
The Main Rule for Hyphenated Surnames
When alphabetizing a hyphenated surname, start
you should treat the entire hyphenated string as a single lexical unit. The hyphen itself is ignored for ordering purposes, although it is retained visually in the final list. This approach keeps the list tidy and predictable, matching the expectations of most users who are familiar with traditional alphabetic ordering Practical, not theoretical..
1.1 The “First‑Element” Principle
- Smith‑Jones → S
- Garcia‑Lopez → G
- O’Connor‑McDonald → O
The first letter of the first component of the surname dictates the position. If the first component is identical across several entries, you move to the next character after the hyphen and compare that part of the name.
1.2 Comparing Two Hyphenated Names
| Name | First Element | Second Element | Result |
|---|---|---|---|
| Smith‑Jones | Smith | Jones | Compare “Smith” first, then “Jones” if needed |
| Smith‑King | Smith | King | “Smith” matches; “Jones” < “King” → Smith‑Jones comes first |
| Garcia‑Lopez | Garcia | Lopez | “Garcia” < “Smith” → Garcia‑Lopez comes before any Smith‑* |
When the first elements differ, you do not need to look beyond the hyphen. The comparison stops as soon as a difference is found Not complicated — just consistent..
1.3 Special Characters and Accents
Hyphenated names may contain apostrophes, accents, or other diacritics. In most modern sorting algorithms (e.g., Unicode collation), these are treated as modifiers that do not change the primary sort key. For instance:
- O’Connor‑McDonald is sorted under O
- Núñez‑García is sorted under N (with ú treated as u for primary comparison)
If you are working with a legacy system that does not support Unicode collation, it is safest to strip accents before sorting, or to use a lookup table that maps accented characters to their base forms.
2. When the Hyphen Is a Delimiter, Not a Part of the Surname
Sometimes the hyphen separates a surname from a middle name or a title, rather than connecting two surnames. For example:
- John‑Doe (first name “John”, surname “Doe”)
- Anne‑Marie‑Smith (first name “Anne‑Marie”, surname “Smith”)
In these cases, you should not treat the hyphenated part as a single unit for sorting. Instead, you follow the standard rule for the type of name component you are sorting:
| Sorting Context | Example | How to Sort |
|---|---|---|
| Alphabetizing by surname | John‑Doe | Sort under D (Doe) |
| Alphabetizing by first name | Anne‑Marie‑Smith | Sort under A (Anne‑Marie) |
The key is to recognize the syntactic role of the hyphen in the name. If the hyphen joins two surnames, use the first‑element rule. If it separates a given name from a surname, treat each part separately And it works..
3. Practical Tips for Different Environments
| Environment | Recommended Practice | Why It Works |
|---|---|---|
| Library catalogs | Treat hyphenated surnames as one unit; use the first element. | Consistency with MARC standards and user expectations. |
| Event guest lists | Follow the first element rule; if the event is formal, consider adding a note: “Smith‑Jones, Mrs. | |
| Business directories | Same as library catalogs; but add a “See also” cross‑reference if the hyphenated name is commonly abbreviated. Consider this: ” | Preserves formality while keeping the list searchable. |
| Digital databases | Store surnames in a dedicated field; keep the hyphen intact. On top of that, | Helps users find the entry under either component. Use database collation settings that ignore hyphens. Now, |
| Academic citations | Use the first element rule; but for author lists, maintain the order of the authors as presented. | Enables efficient querying and accurate sorting. |
4. Edge Cases and Common Pitfalls
| Edge Case | Potential Mistake | Correct Approach |
|---|---|---|
| Names with multiple hyphens (e., Schmidt‑de‑Rossi‑Smith) | Sorting by the first component only, ignoring the rest. Because of that, | Recognize that “Jean‑Luc” is a given name; sort under D for Dupont. g.And |
| Non‑Latin alphabets (e., Иванов‑Петров) | Ignoring Cyrillic letters or treating them as Latin equivalents. | Use locale‑aware collation; “И” > “П” in Cyrillic order. |
| Names with prefixes (e., Jean‑Luc‑Dupont) | Treating “Jean‑Luc” as the surname. Because of that, g. Still, | |
| Hyphenated given names in a surname‑first list (e. g.g.Day to day, , de‑Vries‑van‑Doorn) | Sorting by “de” instead of “Vries”. | Strip common prefixes before sorting, or follow the style guide of the organization. |
5. Automation and Tools
If you are building a software solution that needs to alphabetize hyphenated names, consider the following:
- Use a dependable collation library (e.g., ICU, ICU4J, or the
localemodule in Python). - Normalize strings to a standard form (NFKC) to handle composed characters.
- Strip or ignore hyphens during comparison but preserve them in the output.
- Define custom rules for exceptions (e.g., prefixes, nobility titles).
A small example in Python:
import locale
locale.setlocale(locale.LC_COLLATE, 'en_US.UTF-8')
def sort_key(name):
# Remove hyphens for comparison
cleaned = name.replace('-', ' ')
return locale.strxfrm(cleaned)
names = ['Smith-Jones', 'Smith-King', 'Garcia-Lopez', 'O’Connor-McDonald']
for n in sorted(names, key=sort_key):
print(n)
This will output the names in the correct alphabetical order according to the first‑element rule.
6. Conclusion
Alphabetizing hyphenated names is not as daunting as it first appears. By treating the hyphenated surname as a single unit and following the “first‑element” rule, you ensure consistency across libraries, databases, and everyday lists. Always be mindful of the name’s syntactic role—whether the hyphen joins two surnames or separates a given name from a surname—and apply the appropriate rule. With a clear strategy and the right tools, your lists will remain orderly, searchable, and respectful of the individuals they represent.
7. Quick-Reference Checklist for Implementers
Before deploying any sorting logic to production, run your implementation against this checklist to catch the most common regressions:
| ✅ Check | Why It Matters | Test Case |
|---|---|---|
| First-element priority | Ensures Garcia-Marquez sorts under G, not M. Also, |
['Garcia-Marquez', 'Garcia', 'Garcia-Lopez'] → Garcia, Garcia-Lopez, Garcia-Marquez |
| Hyphen transparency | Hyphens must not act as word breaks in collation. | Smith-Jones vs Smith Jones → identical sort keys. On the flip side, |
| Prefix handling toggle | Some style guides (ALA, Chicago) ignore de, van, von; others (legal, genealogical) do not. |
de Vries sorts under V (library) vs D (phone book). |
| Locale-aware collation | Ö sorts with O in German, but after Z in Swedish. In real terms, |
['Olofsson', 'Östberg', 'Olsson'] → verify against target locale. Because of that, |
| Stable sorting for identical keys | Preserves input order for truly identical names (e. g., duplicates). | Two distinct Smith-Jones records retain relative order. Worth adding: |
| Round-trip fidelity | Display name must remain untouched; only the sort key is transformed. Which means | Input O’Connor-McDonald → Output O’Connor-McDonald (not OConnor McDonald). |
| Performance baseline | Collation key generation (strxfrm) is expensive; cache keys for large datasets. |
100k names sorted in < 500 ms on target hardware. |
8. Alignment with Major Style Guides
| Guide | Rule for Hyphenated Surnames | Rule for Prefixes (de, van, von) |
|---|---|---|
| ALA / Library of Congress | Treat as single unit; alphabetize by first element. And )** | Alphabetize by the first surname element. That said, |
| ISO 999 (Information & Documentation) | Mechanical sort based on Unicode Collation Algorithm (UCA) tailoring. Here's the thing — | |
| **Chicago Manual of Style (17th ed. | Ignore particles in index entries; retain in text. In real terms, g. | |
| **APA (7th ed. | No special stripping; relies entirely on locale tailoring tables. | Include prefixes in alphabetization (e. |
| Genealogical Standards (GEDCOM) | Preserve full structure; SURN tag holds full compound. And , de Vries under D). |
Ignore prefixes (de, van, von, di, la, le) unless the name is non-European or the person prefers otherwise. )** |
Recommendation: Expose the prefix-handling strategy as a configuration flag (e.g., sort_mode: "library" | "academic" | "legal") rather than hard-coding a single behavior.
9. Handling the “Invisible” Characters
Real-world data often contains characters that look like hyphens but behave differently in collation. Normalize these before generating sort keys:
| Character | Unicode | Visual | Recommended Normalization |
|---|---|---|---|
| Hyphen-Minus | U+002D |
- |
Keep (standard). |
| Non-Breaking Hyphen | U+2011 |
‑ |
Map to U+002D. |
| Hyphenation Point | U+2027 |
‧ |
Map |
Continuation of Section9: Handling the “Invisible” Characters
| Character | Unicode | Visual | Recommended Normalization |
|---|---|---|---|
| Hyphenation Point | U+2027 |
‧ |
Map to U+002D (standard hyphen) to ensure consistency in collation. That said, g. O’Connor-McDonald). g.Day to day, |
| Combining Characters | U+0300–U+036F |
Accents/diacritics | Normalize to composed forms (e. |
| Zero-Width Joiner (ZWJ) | U+200D |
Invisible | Remove or treat as a separator depending on context (e.But , in names like O’Connor vs. , Ö instead of O + ¨) to avoid collation mismatches. |
Proper normalization ensures that visually similar characters do not disrupt sorting logic. To give you an idea, a name like Müller (with a combining diaeresis) should sort identically to Müller (with a precomposed Ö). Tools like Unicode normalization forms (NFC/NFD) can automate this process, but manual review may still be necessary for edge cases in legacy or non-standard datasets.
Quick note before moving on.
Conclusion
Sorting names with hyphens and prefixes is a nuanced task that intersects linguistics, cultural conventions, and technical implementation. In practice, normalization ensures consistency across systems, while configurable rules (e. The key challenges—handling invisible characters, reconciling conflicting style guides, and balancing performance—require a multi-layered approach. g., sort_mode) allow adaptability to domain-specific needs, from library catalogs to genealogical databases.
In the long run, the goal is to create a sorting mechanism that respects both technical precision and human context. Consider this: by acknowledging the diversity in naming conventions and the variability of collation rules, developers and data stewards can avoid common pitfalls like misplaced records or inconsistent indexing. As data ecosystems grow more global and complex, such thoughtful design will remain critical to maintaining clarity and accuracy in information retrieval.