ปรับแต่งค่าตัวเลขฐานสอง/ เลขสิบหก/ เลขทศนิยม

เปลี่ยนตัวเลขระหว่างระบบสองตัว, ระบบแปดตัว, ระบบทศนิยม และระบบหกสิบสองตัว โดยใช้ตารางแยกตัวเลข

ตัวเลขทศนิยม —
ตัวเลขฐานสอง —
เลขทศนิยม —
จำนวนแปด —
ความยาวของบิต —

ผลลัพธ์จะปรับปรุงเมื่อคุณพิมพ์

เครื่องคำนวณนี่ให้คำตอบถูกต้องหรือเปล่า

เกี่ยวกับเครื่องคิดเลขนี้

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.

ทำไมต้องใช้ระบบเลขทศนิยมในการคำนวณ

ตัวเลขหกสิบเอ็ดตัว ทุกตัว จะถูกแปลงเป็นบิตสองหลัก 4บิต ดังนั้น หกสิบเอ็ด จึงเป็นวิธีที่สามารถอ่านได้ง่ายในการเขียนค่าไบต์และที่อยู่ของหน่วยความจำ - 0xFF คือไบต์หนึ่งในทั้งหมด

ฉันสามารถป้อนตัวเลขที่ใช้ตัวอักษร 0x, 0b หรือ 0o ได้ไหม?

ใช่ ตัวนำ 0x (เลขสิบหก), 0b (เลขสอง) หรือ 0o (เลขแปด) จะถูกลบออกโดยอัตโนมัติ ดังนั้น คุณสามารถปักหมุดค่าได้โดยตรงจากรหัส แค่แน่ใจว่า ฐานข้อมูลที่คุณเลือก จะตรงกับตัวเลขที่คุณป้อน

ความยาวของบิตบอกอะไรฉัน

นี่คือจำนวนตัวเลขในระบบสองตัวที่ค่าต้องการใช้ ตัวเลขทศนิยม 255 คือ 8 บิต (หนึ่งไบต์) ตัวเลข 256 ใช้9บิต ความยาวของบิตมีประโยชน์ในการเลือกประเภทข้อมูลและตรวจสอบว่าค่าจะเข้ากับไบต์, คำ 16 บิต หรือ ทะเบียน 32 บิตหรือไม่

โอคเทลใช้ทำอะไร

จำนวนอักขระแบบแปดเหลี่ยมจะใช้บิตเป็นกลุ่มเป็นสามและจะแสดงเฉพาะในสิทธิ์ของแฟ้มยูนิกซ์ (เช่น 755 หรือ 644) และระบบเก่าบางตัว จำนวนอักขระแบบแปดเหลี่ยมแต่ละตัวจะแสดงบิตแบบสองตัวสามตัวอย่างแน่นอน เช่นเดียวกับที่จำนวนอักขระแบบหกเหลี่ยมแต่ละตัวจะแสดงบิตแบบสี่ตัวอย่างแน่นอน

ทำไมผมถึงได้ "หมายเลขไม่ถูกต้องสำหรับฐานนี้"

ตัวเลขที่คุณป้อนเข้าไป ไม่ได้ถูกอนุญาตให้ใช้ในฐานที่เลือกไว้ ตัวอย่างเช่น ตัวอักษร F หรือตัวเลข 8 ในระบบสองตัว ซึ่งจะอนุญาตให้ใช้ได้เฉพาะ0และ 1 เปลี่ยนฐานการป้อนให้ตรงกับค่าที่คุณเลือก หรือแก้ไขตัวเลขที่ออกนอกช่วง

❤️ รัก Calculator.Free? แบ่งปันมัน

𝕏  X Facebook Reddit
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);

ผลลัพธ์เป็นเพียงการประมาณการ สำหรับคำแนะนำทั่วไปเท่านั้น ไม่ใช่การเงิน การรักษา หรือคำแนะนำเกี่ยวกับภาษี