diff --git a/src/popup/app/tools/views/toolsPasswordGenerator.html b/src/popup/app/tools/views/toolsPasswordGenerator.html
index b291a088f1e..dcc80599f6b 100644
--- a/src/popup/app/tools/views/toolsPasswordGenerator.html
+++ b/src/popup/app/tools/views/toolsPasswordGenerator.html
@@ -70,7 +70,9 @@
diff --git a/src/services/passwordGenerationService.js b/src/services/passwordGenerationService.js
index 48ea61b09ce..3e3d50d9228 100644
--- a/src/services/passwordGenerationService.js
+++ b/src/services/passwordGenerationService.js
@@ -103,7 +103,7 @@ function initPasswordGenerationService() {
// ref https://github.com/EFForg/OpenWireless/blob/master/app/js/diceware.js
function randomInt(min, max) {
var rval = 0;
- var range = max - min;
+ var range = max - min + 1;
var bits_needed = Math.ceil(Math.log2(range));
if (bits_needed > 53) {