เปลี่ยนฐานตัวเลข

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

ผลลัพธ์ —
เปลี่ยนรูปแบบ —

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

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

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

A number base converter rewrites an integer from one positional base to another — binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16). It reads your value in the source base, works out its plain decimal value, and re-expresses that value in the target base.

Each base uses a fixed set of digits: 0–1 for binary, 0–7 for octal, 0–9 for decimal and 0–9 then A–F for hexadecimal, where A–F stand for 10–15. Because 16 is 2⁴, each hex digit maps to exactly four binary digits, which is why programmers use hex as shorthand for raw bytes.

Worked example: the decimal number 255 is 11111111 in binary and FF in hexadecimal, since 255 = 15×16 + 15. The converter also reports the intermediate decimal value so you can check the working. A results table shows the same number in all four bases at once, and an invalid digit for the chosen source base is flagged rather than silently miscounted.

คำถามที่ถามบ่อย

ฉันจะแปลงเลขทศนิยมเป็นเลขฐานสองได้ยังไง?

Repeatedly divide by 2 and read the remainders from bottom to top. For example 10 in decimal is 1010 in binary, and 255 is 11111111.

เลขทศนิยมใช้ทำอะไร

ระบบทศนิยม (ฐาน 16) ใช้บิตสองตัว4บิต เข้ากับตัวเลขตัวเดียว (0-9และ A- F) ดังนั้น มันจึงเป็นวิธีที่คมชัดในการเขียนไบต์ ตัวเลขทศนิยม 255 คือ FF ในระบบทศนิยม

ทำไมหมายเลขของฉันมีสัญลักษณ์ดอกไม้

ตัวเลขต้องถูกต้องสำหรับฐานแหล่งข้อมูล - ตัวอย่างเช่น 0และ 1 ในระบบสองตัว หรือ 0-9และ A- F ในระบบหกสิบสองตัว ตัวเลขที่ไม่ถูกต้องจะทำให้ผลลัพธ์ไม่ถูกต้อง

ตัวอักษร A ถึง F หมายถึงอะไร ในระบบเลขทศนิยม?

มันเป็นตัวเลขตัวเดียวสำหรับค่าตั้งแต่ 10 ถึง 15 A คือ 10 B คือ 11 จนถึง F ซึ่งเป็น 15 นี่จะทำให้ฐาน 16 สามารถใส่ตัวเลขได้ถึง 15 ก่อนที่มันจะต้องบรรจุ

ทำไมทุกตัวเลข 16 หลัก เท่ากับ4ตัวเลข 20 หลัก

Because 16 equals 2 to the fourth power, every hexadecimal digit covers exactly four bits. So the byte 11111111 groups into 1111 1111, which is FF — this number base converter does that grouping for you.

เครื่องแปลงนี้สามารถจัดการกับตัวเลขที่ใหญ่มากได้ไหม

มันทำงานกับตัวเลขสมบูรณ์ และมีความแม่นยำ จนถึงช่วงที่ถูกเก็บตัวเลขสมบูรณ์อย่างแน่นอน (ประมาณ9แคดริลลี่ หรือ 2⁵³) นอกเหนือจากนั้น ข้อความในระบบสองตัวหรือระบบหกสิบสิบหลักที่ยาวมาก ๆ อาจจะสูญเสียความแม่นยำในตัวเลขสุดท้ายของมัน

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

𝕏  X Facebook Reddit
API - ใช้เครื่องคิดเลขนี้จากโค้ด

เรียกเครื่องคิดเลขนี้เป็นจุดจบ JSON แบบฟรี - ไม่จำเป็นต้องใช้กุญแจ ส่งค่าในช่องด้านล่างนี้เป็นพารามิเตอร์คำถามหรือ JSON ทุกอย่างที่คุณลบออก จะใช้ค่าปริยายที่หน้านี้ใช้อยู่ พารามิเตอร์ที่ไม่รู้จักคือ 400 และไม่เคยเป็นศูนย์ที่เงียบ อ่านเอกสาร API ทั้งหมด →

จุดสิ้นสุด

GET https://calculator.free/api/v1/number-base/

curl

curl "https://calculator.free/api/v1/number-base/?amount=255&from=10&to=2"

JavaScript fetch()

const r = await fetch(
  "https://calculator.free/api/v1/number-base/?" + new URLSearchParams({
    "amount": "255",
    "from": "10",
    "to": "2"
  }));
const data = await r.json();
console.log(data.results);

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