Upload a file
  1. base64hub
  2. Other bases
  3. Decimal to Base64

Decimal to Base64 Converter: Byte Lists to Base64

Paste decimal byte values such as 72 105 33 or [72, 105, 33] and get Base64 (SGkh). Values from 0 to 255 work, and −128 to −1 are read as Java-style signed bytes.

Free no sign-up, no limits Local nothing uploaded Updated Oct 27, 2026
Input 0Bytes 0 BOutput 0

Processed in your browser. This page cannot send your data anywhere – how we know

How to convert decimal to Base64

  1. Paste the numbers into Input · Decimal bytes. Each number is one byte.
  2. The Base64 appears in Output · Base64 as you type.
  3. Under the output, Padding (=) keeps or drops the trailing =, and Line wrap splits long output at 64 or 76 characters.
  4. Copy output, or flip to Base64 → Decimal bytes to check the result. Base64 to Decimal is the same tool the other way round.

Input formats

InputSourceBase64
72 105 33plain listSGkh
[72, 105, 33]JSON, Python list(b)SGkh
{72, 105, 33}C or Java initializerSGkh
72;105;33CSV exports with ;SGkh
[72, 105, -1]Java Arrays.toString(bytes)SGn/
072 105zero-padded columnsSGk=

Zero-padded numbers are read as decimal, so 072 is 72. Each value must be a whole number from −128 to 255. A value outside that range stops the conversion and the message says which one; a stray letter or a dot, as in 72.105, is reported with its position and Show selects it.

If the list holds hex values such as 48 69 21, they would be read as the decimals 48, 69 and 21 and give a different result. Use Hex to Base64 for those. For arrays copied from source code with 0x values, casts or type names, Byte Array to Base64 is the better fit.

Where decimal byte lists come from

Most decimal byte lists are a programming language printing binary data in its default way:

WhereWhat it prints for Hi!
Python list(b"Hi!")[72, 105, 33]
Node.js JSON.stringify(Buffer.from("Hi!")){"type":"Buffer","data":[72,105,33]}
Java Arrays.toString("Hi!".getBytes())[72, 105, 33]
JavaScript Array.from(new TextEncoder().encode("Hi!"))[ 72, 105, 33 ]

Converting such a list to Base64 gives you a compact string to put in a config file, a test fixture or an API request. 72, 105, 33 is 11 characters; the Base64 SGkh is 4.

Decimal to Base64 in code

import base64
base64.b64encode(bytes([72, 105, 33])).decode()   # 'SGkh'

bytes() raises ValueError: bytes must be in range(0, 256) for negative values. Convert Java-style signed bytes first with [v & 0xff for v in values].

Buffer.from([72, 105, 33]).toString("base64");   // 'SGkh'

Buffer.from takes each value modulo 256 without complaint, so -1 becomes 255 and 256 silently becomes 0. The tool above refuses 256, which catches lists that are not really bytes. See the Python and Node.js pages for more.

Numbers that are not bytes

A single large number, such as a user ID, a timestamp or a counter, has no single Base64 form until you choose how many bytes it occupies and in which order. The Unix time 1700000000 as a 4-byte big-endian value is ZVPxAA==; as 8 bytes it is AAAAAGVT8QA=. Pick the layout the receiving system expects and encode it in code; this page deliberately rejects values above 255 so that a list of 16-bit or 32-bit numbers is not mistaken for bytes.

FAQ

Can I convert a single number like 1000 to Base64?

Not on this page, because every number here is one byte and 1000 does not fit. Decide how many bytes and which byte order the number should have, then encode those bytes. In Python: base64.b64encode((1000).to_bytes(2, "big")) gives A+g=.

What separators can I use between the numbers?

Spaces, tabs, new lines, commas and semicolons, in any mix. Square, curly and round brackets are ignored, so a JSON array or a C initializer pastes as it is.

How are negative numbers handled?

−1 to −128 are read as signed bytes, the way Java and Kotlin print them: −1 is 255 and −128 is 128. Anything below −128 is an error.

How do I convert a JSON byte array to Base64?

Paste the array, brackets included. For Node’s {"type":"Buffer","data":[...]} objects, paste only the data array.