Decimal to Base64 Converter
Encode a decimal byte array (0-255 per value) to a Base64 string.
13 bytes parsed
How decimal-to-Base64 conversion works
Base64 encodes raw bytes as printable ASCII text using 64 characters (A–Z, a–z, 0–9, + and /), padded with = to a multiple of 4 characters. Each group of 3 input bytes becomes 4 Base64 characters, which is why encoded output is roughly 33% larger than the original data.
This tool treats each number you enter as one byte (0-255), builds the raw byte sequence, then Base64-encodes it. For example, the decimal bytes 72, 101, 108, 108, 111 (the ASCII codes for "Hello") encode to SGVsbG8=. All conversion happens locally in your browser — nothing is uploaded anywhere.
Built and maintained by Meet Shah · Last updated
What this tool is used for
- Encoding a byte array from a protocol trace into Base64 for a text field.
- Producing a Base64 value from raw byte values you have as numbers.
- Checking that your own byte-to-Base64 conversion matches a reference.
- Building a test fixture from explicit byte values.
- Converting a decimal byte dump into a compact transportable form.
Frequently Asked Questions
- What input does it expect?
- A list of byte values, 0–255, separated by commas, spaces or newlines. Each token must be a non-negative integer in that range; anything above 255 is not a byte and is reported as an error rather than truncated, because masking off the high bits would corrupt the output invisibly.
- How does the encoding work?
- The bytes are assembled into a binary string — one character per byte, char code 0–255 — and passed to `btoa`. That is the browser's native path for encoding raw bytes, and the reference case is checkable: [72,101,108,108,111,44,32,87,111,114,108,100,33] gives `SGVsbG8sIFdvcmxkIQ==`.
- Why does the output end in equals signs?
- Padding. Base64 packs three bytes into four characters, so an input length that is not a multiple of three leaves a partial group — one `=` for two leftover bytes, two for one. Thirteen bytes is four groups plus one, hence the `==` on the Hello, World example.
- How much does Base64 inflate the data?
- By exactly a third: four output characters per three input bytes, so 33% before padding. That is the cost of making binary safe for a text channel, and it is why inlining a large image as a data URI is usually a worse trade than one extra request for it.
- Is Base64 a form of encryption?
- No, and treating it as one is a recurring security mistake. It is a reversible encoding with no key — anyone can decode it instantly. It exists to move bytes through systems that only handle text, not to hide anything from anyone.
Common errors and gotchas
- Including values above 255, which are not bytes and cannot be encoded as such.
- Mixing separators so the byte boundaries become ambiguous.
- Assuming the decimal values are characters rather than bytes, which differ for anything non-ASCII.
- Expecting the output to be shorter than the input, when Base64 always grows the underlying bytes by a third.
- Confusing standard Base64 with the URL-safe variant when the destination requires one specifically.