diff --git a/diceware/__init__.py b/diceware/__init__.py
index 18ae20b95789fe18195bed666d059eeb0c23e823..8a87c7a2185719c8ddc2216816604e834b22e8a4 100644
--- a/diceware/__init__.py
+++ b/diceware/__init__.py
@@ -124,6 +124,24 @@ def handle_options(args):
     return args
 
 
+def get_wordlist_names():
+    """Get a all names of wordlists stored locally.
+    """
+    result = []
+    filenames = os.listdir(WORDLISTS_DIR)
+    for filename in filenames:
+        if not os.path.isfile(os.path.join(WORDLISTS_DIR, filename)):
+            continue
+        if not "_" in filename:
+            continue
+        if not "." in filename:
+            continue
+        basename = filename.split(".")[0]
+        name = basename.split("_", 1)[1]
+        result.append(name)
+    return sorted(result)
+
+
 def get_wordlist(file_descriptor):
     """Parse file in `file_descriptor` and build a word list of it.
 
diff --git a/tests/test_diceware.py b/tests/test_diceware.py
index d710ddf98d308605b07c23874d8d62f1e87963b4..6c19b26d9542ac5bb074207c13739dca4b69845c 100644
--- a/tests/test_diceware.py
+++ b/tests/test_diceware.py
@@ -8,6 +8,7 @@ from diceware import (
     WORDLISTS_DIR, RE_WORDLIST_NAME, SPECIAL_CHARS, get_wordlist,
     get_wordlist_path, insert_special_char, get_passphrase,
     handle_options, main, __version__, print_version, get_random_sources,
+    get_wordlist_names,
     )
 
 
@@ -120,6 +121,12 @@ class TestDicewareModule(object):
         assert exc_info.value.args[0].startswith(
             'Not a valid wordlist name')
 
+    def test_get_wordlist_names(self, wordlists_dir):
+        # we can get wordlist names also if directory is empty.
+        wlist_path = wordlists_dir.join('mywordlist_en_8k.txt')
+        wlist_path.write("some\nirrelevant\nwords")
+        assert get_wordlist_names() == ['en_8k']
+
     def test_insert_special_char(self):
         # we can insert special chars in words.
         fake_rnd = FakeRandom()