What this tool does
It bridges two representations: a plain decimal integer and a Base64 string. Base64 is defined over bytes, so a number is first serialised to bytes and only then encoded.
How it works
To encode, the decimal value is parsed into a BigInt and repeatedly masked and shifted by 8 bits to produce its minimal big-endian byte sequence — the most-significant byte first, with no superfluous leading zero bytes (zero itself is a single 0x00 byte). Those bytes are then passed through standard Base64 encoding, which groups every 3 bytes into 4 printable characters and pads with =.
To decode, the Base64 is converted back to bytes, and the bytes are read big-endian into a BigInt: each byte shifts the accumulator left 8 bits and ORs in the next byte.
Example and notes
The number 65535 fits in two bytes, FF FF, which Base64-encode to //8=. A larger value like 16777216 becomes the bytes 01 00 00 00 and encodes accordingly. The tool always shows the intermediate hex bytes so the mapping is transparent.
Remember that Base64 carries byte-length information, while an integer does not: encoding-then-decoding a number always round-trips, but two different Base64 strings differing only by leading zero bytes can decode to the same integer. Use standard Base64 here; swap +/ for -_ if you need the URL-safe alphabet.