ຕົວບວກສອງ / ຕົວຮ້ອຍຫົກ / ຕົວບວກດັດຊະນີ
ປ່ຽນຕົວເລກລະຫວ່າງສອງ, ແປດ, ສິບ ແລະ ແປດສິບຫ້າ, ດ້ວຍຕາຕະລາງແບ່ງອອກເປັນສ່ວນໆ.
ຜົນການຄົ້ນຫາຈະຖືກອັບເດດເມື່ອທ່ານພິມມັນຂຶ້ນມາ ។
ກ່ຽວກັບເຄື່ອງຄິດໄລ່ນີ້
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.
ຄໍາຖາມທີ່ຖາມເລື້ອຍໆ
ວິທີການທີ່ຂ້ອຍຈະປ່ຽນຕົວເລກເປັນຮ້ອຍຮ້ອຍເປັນຕົວເລກຮ້ອຍຫ້າຮ້ອຍຢ່າງໃດ?
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.
ເຮັດຫຍັງຈຶ່ງໃຊ້ລະບົບຮັກສິບໃນການຄິດໄລ່?
ຕົວເລກ hex ແຕ່ລະຕົວ ຖືກວາງແຜນໃຫ້ເປັນ 4- bit binary ຢ່າງແທ້ຈິງ, ສະນັ້ນ hex ແມ່ນວິທີການອ່ານທີ່ງ່າຍດາຍ, ງ່າຍຕໍ່ການອ່ານເພື່ອຂຽນຄ່າຂອງໄບຕ໌ແລະທີ່ຢູ່ຂອງຄວາມ ຈຳ - 0xFF ແມ່ນໄບຕ໌ດຽວຂອງທຸກຄົນ.
ຂ້ອຍສາມາດໃສ່ຕົວເລກດ້ວຍຕົວກ່ອນ 0x, 0b ຫຼື 0o ໄດ້ບໍ?
ຖືກ. ຕົວແທນ 0x (hex), 0b (binary) ຫຼື 0o (octal) ກ່ອນໜ້າຈະຖືກລົບອອກໂດຍອັດຕະໂນມັດ, ສະນັ້ນທ່ານສາມາດບີບອັດຄ່າໂດຍກົງຈາກໂປຣແກຣມໄດ້. ພຽງແຕ່ຮັບປະກັນວ່າພື້ນຖານການເຂົ້າເຖິງທີ່ທ່ານໄດ້ເລືອກແມ່ນກົງກັບຕົວເລກທີ່ທ່ານໄດ້ໃສ່ເຂົ້າມາ.
ຄວາມຍາວຂອງ bit ສະແດງໃຫ້ເຫັນຫຍັງ?
ຕົວເລກສອງຕົວທີ່ຄ່າຕ້ອງການ. ຕົວເລກ 255 ເປັນ 8 ບິດ (ບິດໜຶ່ງ); 256 ຕ້ອງການ9ບິດ. ຄວາມຍາວຂອງບິດແມ່ນມີປະໂຫຍດສຳລັບການເລືອກປະເພດຂໍ້ມູນ ແລະ ກວດເບິ່ງວ່າຄ່າຈະເໝາະສົມກັບບິດ, ຄໍາ 16- ບິດ ຫຼື ບັນທຶກ 32- ບິດ.
ຕົວອັກສອນ octal ຖືກໃຊ້ເພື່ອຫຍັງ?
ກຸ່ມ Octal ປະກອບດ້ວຍ ສາມບິດ ແລະ ສະແດງອອກໂດຍສະເພາະໃນການອະນຸຍາດຂອງໄຟລ໌ Unix (ເຊັ່ນ 755 ຫຼື 644) ແລະ ລະບົບເກົ່າບາງຢ່າງ. ຕົວເລກ octal ແຕ່ລະອັນວາງແຜນໃຫ້ເປັນສາມບິດໄບນາຣີຢ່າງແທ້ຈິງ, ວິທີທີ່ຕົວເລກ hex ແຕ່ລະອັນວາງແຜນໃຫ້ເປັນສີ່.
ເຮັດຫຍັງຂ້ອຍໄດ້ຮັບ "ຕົວເລກທີ່ບໍ່ຖືກຕ້ອງສໍາລັບຖານຂໍ້ມູນນີ້"?
ຕົວເລກທີ່ທ່ານໄດ້ໃສ່ບໍ່ຖືກອະນຸຍາດໃຫ້ໃຊ້ໃນຖານທີ່ໄດ້ເລືອກ - ຕົວຢ່າງຄືຕົວອັກສອນ F ຫຼື ຕົວເລກ 8 ໃນຕົວເລກສອງຕົວ, ເຊິ່ງອະນຸຍາດໃຫ້ໃຊ້ໄດ້ແຕ່0ແລະ 1. ປ່ຽນຖານການເຂົ້າເຖິງໃຫ້ກົງກັບຄ່າຂອງທ່ານ ຫຼື ແກ້ໄຂຕົວເລກທີ່ບໍ່ຢູ່ໃນຂອບເຂດ.
API — ໃຊ້ເຄື່ອງຄິດໄລ່ນີ້ຈາກໂປຣແກຣມ
ໂທເຄື່ອງຄິດໄລ່ນີ້ເປັນຈຸດຈົບ JSON ຟຣີ - ບໍ່ຕ້ອງການກູໂກ. ສົ່ງຄ່າພື້ນທີ່ຂ້າງລຸ່ມນີ້ເປັນປາຣມາຕິກຄໍາຖາມ ຫຼື JSON. ທຸກສິ່ງທີ່ທ່ານລົບອອກ ຈະໃຊ້ຕົວອັກສອນທີ່ໜ້ານີ້ໄດ້ຕື່ມໄວ້ກ່ອນ; ພາຣາມິເຕີທີ່ບໍ່ຮູ້ແມ່ນ 400, ບໍ່ແມ່ນສະກຸນທີ່ບໍ່ມີສຽງເລີຍ. ອ່ານເອກະສານ API ເຕັມ →
ຈຸດສຸດທ້າຍ
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);
ຜົນໄດ້ຮັບແມ່ນຄາດຄະເນສໍາລັບຄໍາແນະນໍາທົ່ວໄປເທົ່ານັ້ນ, ບໍ່ການເງິນ, ຄໍາແນະນໍາທາງການແພດຫຼືພາສີ.