Biner / Hex / Decimal Converter
Ubah nomor antara biner, oktal, desimal dan heksadesimal, dengan tabel kerusakan.
Hasil update saat Anda mengetik.
Tentang kalkulator ini
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.
Sering kali mengajukan pertanyaan
Bagaimana saya mengubah desimal menjadi heksadesimal?
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.
Mengapa heksadesimal digunakan dalam komputasi?
Each hex digit maps to exactly four binary bits, so hex is a compact, readable way to write byte values and memory addresses — 0xFF is one byte of all ones.
Dapatkah saya memasukkan nomor dengan 0x, 0b atau 0o prefiks?
Ya. Awalan 0x (hex) terkemuka, 0b (binari) atau 0o (octal) dilucuti secara otomatis, sehingga Anda dapat menempelkan nilai langsung dari kode. Pastikan dasar masukan yang Anda pilih cocokkan dengan digit yang Anda masukkan.
Berapa lama lagi?
Ini adalah berapa digit biner yang dibutuhkan. Nilai yang dibutuhkan. Nilai desimal 255 adalah 8 bit (satu byte); 256 membutuhkan 9 bit. Panjang bit berguna untuk memilih tipe data dan memeriksa apakah nilai cocok dalam sebuah byte, 16-bit word atau 32-bit register.
Untuk apa oktal digunakan?
Kelompok oktal bit dalam tiga dan muncul terutama dalam izin berkas Unix (seperti 755 atau 644) dan beberapa sistem warisan. Setiap peta digit oktal ke persis tiga bit biner, cara masing-masing hex peta ke empat.
Mengapa aku mendapatkan "nomor tidak valid untuk pangkalan ini"?
Sebuah digit yang Anda masukkan tidak diperbolehkan dalam dasar yang dipilih å misalnya huruf F atau digit 8 dalam angka biner, yang hanya mengizinkan 0 dan 1. Ganti basis masukan untuk mencocokkan nilai Anda, atau memperbaiki digit yang tidak sama.
API — use this calculator from code
Sebut kalkulator ini sebagai titik akhir JSON Gratis tidak diperlukan kunci. Kirim nilai ruas di bawah sebagai parameter query atau JSON. Apa pun yang Anda abaikan menggunakan baku yang sama halaman ini sudah diisi dengan; sebuah parameter tidak diketahui adalah 400, tidak pernah nol diam. Baca dokumen API penuh →
Titik Akhir
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);
Hasil diperkirakan hanya untuk bimbingan umum, bukan keuangan, medis atau pajak.