[X]

Numbers That Spell Words

luljs still works

Print certain numbers in base 16 and real words fall out.

In 2026: Still works. Number.prototype.toString takes a radix from 2 to 36. Because the hex digits run 0 to 9 then a to f, some numbers spell words: 3735928559 is deadbeef, 12648430 is c0ffee, and 11259375 is abcdef. The same trick converts any number to binary or any base in between.

Where it came from: Number.prototype.toString accepts a radix from 2 to 36, documented on MDN. MDN

<script>
document.write('<p><code>(3735928559).toString(16)</code> is <b>' + (3735928559).toString(16) + '</b></p>');
document.write('<p><code>(12648430).toString(16)</code> is <b>' + (12648430).toString(16) + '</b></p>');
document.write('<p><code>(11259375).toString(16)</code> is <b>' + (11259375).toString(16) + '</b></p>');
</script>
sandboxed demo · breaks nothing but itselfrestart

More in luljs

all 63 in luljs › · the whole library ›