Sort Spanish words in correct dictionary order
Sorting Spanish is not the same as a plain ASCII sort. The letter ñ belongs between n and o, accents should be ignored for primary ordering, and — in older dictionaries — the digraphs ch and ll counted as single letters with their own positions. This tool sorts your list with modern Unicode Spanish collation by default and offers a legacy mode that reproduces pre-1994 dictionary order.
How it works
In modern mode the tool uses the browser’s Intl.Collator set to the Spanish
(es) locale with sensitivity: "base", which orders by base letter, places ñ
after n, and treats accents as a tie-breaker rather than a primary key. In
legacy mode it first rewrites each word so that ch and ll map to sort keys
that fall just after c and l respectively, then compares those keys, so
chico sorts after cuna and before dado, exactly as an old dictionary would
list it. Original spelling and case are preserved in the output.
Tips and example
Given loro, leña, lena, llave, luz in modern mode you get lena, leña, llave, loro, luz — note ll sorts as l+l, so llave falls between leña and loro. In
legacy mode the same list becomes lena, leña, loro, luz, llave, because ll
is now its own letter after l. Use modern mode for anything new; reach for
legacy mode only when matching a historical index or an old printed dictionary.
Reverse the order for a Z-to-A listing.