decimal, binary, octal, hex and any custom base
curl -sX POST 'https://api.whittly.dev/v1/base/convert' \
-H 'Authorization: Bearer $WHITTLY_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"input":"255","fromBase":10,"toBases":[2,8,16]}'
const res = await fetch('https://api.whittly.dev/v1/base/convert', {
method: 'POST',
headers: {
'Authorization': 'Bearer ' + apiKey,
'Content-Type': 'application/json',
},
body: JSON.stringify({ input: "255", fromBase: 10, toBases: [2, 8, 16] }),
});
const data = await res.json();
const { data } = await axios.post(
'https://api.whittly.dev/v1/base/convert',
{ input: "255", fromBase: 10, toBases: [2, 8, 16] },
{ headers: { Authorization: 'Bearer ' + apiKey } }
);
Computers operate in binary (base 2), but humans prefer decimal (base 10). Hexadecimal (base 16) is used in color codes, memory addresses, and character encodings. Octal (base 8) appears in Unix file permissions. This tool converts between any of these — or any custom base from 2 to 36.