diff --git a/script.js b/script.js
index d7703d1a47139db06082e9b5d7641cf40006a964..930cd47f4a15b5d1eba2a96f8dcc1a573a9c8edd 100644
--- a/script.js
+++ b/script.js
@@ -38,6 +38,14 @@ function sort_and_copy(ev){
   }
 
   lines = lines.sort(natural_compare);
+
+  // if there was an empty line it will be first array item now - remove
+  if (check_unique.checked) {
+    if (lines[0] == "") {
+      lines = lines.slice(1);
+    }
+  }
+
   textarea.value = lines.join("\n");
 
   window.getSelection().removeAllRanges();