diff --git a/powers-of-2.html b/powers-of-2.html
index f83c7a7..6420364 100644
--- a/powers-of-2.html
+++ b/powers-of-2.html
@@ -27,8 +27,11 @@
Powers of 2 Calculator
result.innerHTML = (2 ** x).toFixed(100).replace(/(\.0+|0+)$/, "");
} else {
powerOf.innerHTML = "2" + x + " (" + Math.floor(Math.log10(2) * x + 1) + " digit/s)";
-result.innerHTML = 2n ** BigInt(x);
-}});
+if (x > 300) {
+result.innerHTML = BigInt(2 ** 300) * 2n ** BigInt(x - 300);
+} else {
+result.innerHTML = (2 ** x).toPrecision(100).replace(/(\.0+|0+)$/, "");
+}}});