I-Binary / Hex / Decimal Converter
Guqula inani phakathi kwe-binary, octal, decimal ne hexadecimal, ngethebula lokuhlukaniswa.
Iziphetho zivuselelwa uma ubhala.
Malunga nale khadi
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.
Imibuzo ebuzwa kaningi
Ngiguqula kanjani i-decimal ibe yi-hexadecimal?
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.
Kungani i-hexadecimal isetshenziswa ekusebenzeni?
Inombolo ye hex ngayinye ikhombisa ama-bit amabili aphelele, ngakho-ke i-hex iyindlela elula, efundeka yokubhala ama-bytes namakheli e-memori — 0xFF yi-byte eyodwa yazo zonke.
Ingabe ngingenza inani nge 0x, 0b noma 0o iziqephu?
Yebo. I-0x (hex), 0b (binary) noma 0o (octal) isiqephu esiphambili sisuswa ngokuzenzakalela, ngakho ungafaka amaxabiso ngokuqondile kusuka ku-code. Qinisekisa ukuthi isingeniso esiyinhloko okhethayo sifana nezinhlamvu ozifakayo.
Yini okusho ukuthi ubude be-bit?
Inombolo yezinhlamvu ezi-binomial ezidingayo ixabiso. I-decimal 255 iyisi-8 bits (i-byte eyodwa); i-256 idinga ama-bits angu-9. Ubude be-bit busetshenziswa ukukhethwa kwezinhlobo zedatha nokubheka ukuthi ixabiso lilungele i-byte, i-16-bit word noma i-32-bit register.
I-octal isetshenziswa kuphi?
Iqembu le-octal lihlanganisa ama-bits ezithathu futhi livela kakhulu ku-Unix file permissions (njenge-755 noma i-644) nakwezinye izimiso ezidala. Inombolo ye-octal ngayinye i-maps ku-bithi ezimbili eziqondile ezithathu, indlela ngayinye yenombolo ye-hex i-maps ku-ne.
Kungani ngithola "inani elingalunganga lesisekelo"?
Inombolo engeniswe ayivunyelwanga esisekelo esikhethiwe - isibonelo, umbhalo F noma inani 8 kunombolo eyisithupha, evumela kuphela 0 ne 1. Qhafaza isisekelo sokungenisa ukuze ulinganise inani lakho, noma ulungise inani elingaphandle ko range.
API — sebenzisa le calculator kusuka kukhodi
Nquma le calculator njenge JSON evulekile yendawo yokuqeda - akukho isithonjana esidingekayo. Thumela amaxabiso endawo ngezansi njengezilungiselelo zombuzo noma i-JSON. Noma yini ongayishiya isebenzisa iphutha elifanayo elifakwe ngaphambili lekhasi; ipharamitha engaziwa yi-400, ayikho i-zero emnyama. Funda i-API egcwele →
Ingxenye yendawo
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);
Izibalo ziyisilinganiso esisetshenziswa ukuqondisa kuphela, hhayi ukucebisa ngezimali, ukwelashwa noma ukukhokha.