Base64 to Integers Converter
Convert Base64 encoded strings to integer arrays. Supports uint8, int8, uint16, int16, uint32, int32 with big/little endian byte order.
About
Base64 encoding represents binary data as ASCII text using a 64-character alphabet (A - Z, a - z, 0 - 9, +, /). Every 4 Base64 characters encode exactly 3 raw bytes. Misinterpreting the byte order or signedness when converting those bytes to integers is a common source of bugs in protocol implementations, firmware uploads, and cryptographic key parsing. This tool decodes a Base64 string into its constituent bytes, then interprets them as integer sequences under the exact type width and endianness you specify. It supports unsigned and signed variants at 8, 16, and 32-bit widths. Padding (=) is handled per RFC 4648.
Limitations: this tool operates on standard Base64 (RFC 4648 ยง4). Base64url variants (- and _ instead of + and /) are auto-detected and normalized. Inputs that do not decode to a byte count divisible by the chosen type width will process only complete groups and flag the remainder. Float interpretation (IEEE 754) is outside scope.
Formulas
Base64 decoding maps each group of 4 encoded characters back to 3 raw bytes. The total decoded byte count is:
where B = decoded byte count, L = length of Base64 string (excluding whitespace), P = number of padding = characters (0, 1, or 2).
For multi-byte integer interpretation, bytes are grouped into chunks of width W (1, 2, or 4). The number of complete integers is:
For unsigned big-endian reconstruction of a W-byte value from bytes b0, b1, โฆ, bWโ1:
For little-endian, the exponent is simply i instead of Wโ1โi. For signed (two's complement) conversion:
where v = unsigned interpretation, W = byte width, and bi = the i-th byte in the group.
Reference Data
| Integer Type | Width | Range Min | Range Max | Bytes per Value | Endian Relevant |
|---|---|---|---|---|---|
| uint8 | 8 bit | 0 | 255 | 1 | No |
| int8 | 8 bit | โ128 | 127 | 1 | No |
| uint16 | 16 bit | 0 | 65535 | 2 | Yes |
| int16 | 16 bit | โ32768 | 32767 | 2 | Yes |
| uint32 | 32 bit | 0 | 4294967295 | 4 | Yes |
| int32 | 32 bit | โ2147483648 | 2147483647 | 4 | Yes |
| Common Base64 Reference Strings | |||||
AA== | Decodes to | 1 byte: [0] | |||
/w== | Decodes to | 1 byte: [255] | |||
AQI= | Decodes to | 2 bytes: [1, 2] | |||
AQID | Decodes to | 3 bytes: [1, 2, 3] | |||
AAAAAQ== | uint32 BE | 0, then incomplete (only 1 trailing byte) | |||
SGVsbG8= | ASCII | [72, 101, 108, 108, 111] = "Hello" | |||
gIA= | int8 | [โ128, โ128] | |||
//8= | uint16 BE | [65535] | |||
/////w== | uint32 BE | [4294967295] | |||
AAAAAAAAAAE= | uint32 BE | [0, 0] + 1 trailing byte | |||