Binarni / Hex / Decimalni pretvornik
Pretvori broj između binarne, oktalne, decimalne i heksadecimalne, s razlomnom tablicom.
Rezultati ažuriranja dok kucate.
O ovom kalkulatoru
A binary, hex and decimal converter shows the same whole number across number bases. Computers ultimately work in binary (base 2), but programmers routinely switch between bases to make values readable: decimal (base 10) for everyday quantities, hexadecimal (base 16) for byte values and memory addresses, and octal (base 8) for things like Unix file permissions. This converter takes a whole number in any of those four bases and shows it in all four at once, along with its bit length. The digits allowed in each base go up to one less than the base — binary uses 0–1, octal 0–7, decimal 0–9 and hex 0–9 then A–F for 10–15 — and the tool rejects digits that are out of range for the base you pick.
As a worked example, the decimal value 255 is FF in hexadecimal, 377 in octal and 11111111 in binary — eight bits all set, i.e. exactly one byte at its maximum. To convert decimal to hex by hand you repeatedly divide by 16 and read the remainders from last to first; the calculator does it instantly and also accepts input prefixed with 0x (hex), 0b (binary) or 0o (octal) and handles negative numbers.
The reason hexadecimal is so common in computing is that each hex digit maps to exactly four binary bits (a nibble), so two hex digits describe one byte with no ambiguity — which is why colour codes like #FF8800, MAC addresses and memory dumps are written in hex. This tool is handy for bit masks, colour values, debugging register contents and any low-level work where you need to see the same number across bases.
Česta pitanja
Kako da pretvorim desetnu u heksadecimalnu?
Repeatedly divide by 16 and read the remainders from last to first, using A–F for 10–15. Decimal 255 is FF in hex and 11111111 in binary.
Zašto se u računalima koristi heksadecimal?
Svaka hex cifra mapira na točno četiri binarna binarna bita, tako da hex je kompaktan, čitljiv način za pisanje bajtova vrijednosti i memorijske adrese – 0xFF je jedan bajt od svih.
Mogu li uvesti brojeve s 0x, 0b ili 0o prefiksa?
Da. Vodeći 0x (hex), 0b (binarni) ili 0o (oktalni) prefiks se automatski oduzima, tako da možete umetnuti vrijednosti ravno iz koda. Samo se pobrinite da unosna baza koju odaberete odgovara brojevima koje unesete.
Što mi ta duljina kaže?
To je koliko binarnih cifara vrijednost treba. Decimal 255 je 8 bitova (jedan bajt); 256 treba 9 bitova. Duljina bita je korisna za odabir tipova podataka i provjeru uklapa li se vrijednost u bajt, 16-bitni registar ili 32-bitni registar.
Za što se oktalno koristi?
Oktalne grupe bitova u trojkama i pojavljuje se uglavnom u Unix dozvole datoteke (kao 755 ili 644) i neke nasljeđe sustave. Svaka oktalna brojka mapira na točno tri binarna bita, način na koji svaka hex cifra mapira na četiri.
Zašto sam dobio "nevažan broj za ovu bazu"?
Unesena cifra nije dopuštena u odabranu osnovu — na primjer, slovo F ili broj 8 u binarnom broju, što dopušta samo 0 i 1. Prebacite unosnu osnovu da odgovara vašoj vrijednosti, ili ispravite izvan dometa.
API – koristi ovaj kalkulator iz koda
Nazovi ovaj kalkulator kao slobodan JSON ishod — nije potreban ključ. Pošaljite vrijednosti polja ispod kao parametre upita ili JSON. Sve što opustite koristi istu uobičajenu stranicu je napunjena; nepoznati parametar je 400, nikada tiha nula. Pročitajte cijeli API dokumenata →
Krajnji točki
GET https://calculator.free/api/v1/binary-hex/
curl
curl "https://calculator.free/api/v1/binary-hex/?value=255&base=10"
JavaScript fetch()
const r = await fetch(
"https://calculator.free/api/v1/binary-hex/?" + new URLSearchParams({
"value": "255",
"base": "10"
}));
const data = await r.json();
console.log(data.results);
Rezultati su procjene za opće smjernice samo za financijske, medicinske ili porezne savjete.