Chuyển tới nội dung
Number Buffet

Chuyển đổi hệ cơ số

Chuyển một số giữa hai hệ cơ số bất kỳ từ 2 đến 36, với số học nguyên lớn chính xác và không mất chữ số nào.

Đọc 3 phút

Thiết lập

Thiết lập nhanh

Spaces, underscores, commas and apostrophes are ignored, so 1010_1010 and 1,024 both work. Use a full stop for the radix point, and a leading minus for negatives.

A matching 0b, 0o or 0x prefix on the value is accepted and stripped.

How far to expand a fractional part. Many fractions never terminate in the target base — 0.1 in base 10 repeats forever in base 2 — so the expansion is cut here and flagged.

Affects the digits above 9 in bases 11 and up.

Only bases 2, 8 and 16 have a conventional prefix.

Binary in fours, hexadecimal in byte pairs, octal in threes, decimal in thousands.

Lists the same value in all 35 bases, ignoring the target base above.

Tinh chỉnh dáng vẻ

Hãy chọn một thiết lập cạnh ảnh trước — các điều khiển này điều chỉnh nó.

Frame

A border drawn inside the edge of the image.

Nâng cao

Kết quả

1 giá trị

FF

255 in base 10 is FF in base 16.


Tạo ảnh

Hãy bật JavaScript để tạo kiểu cho những số này và tải về dưới dạng ảnh. Bản thân các giá trị đã được liệt kê ở trên.

Text on the image

Drag a line straight onto the picture to place it — once placed, it stays exactly where you put it. Everything here is drawn into the download.

Bài viết nền bên dưới chưa được dịch và đang hiển thị bằng tiếng Anh.

Về chuyển đổi hệ cơ số

Positional notation — the idea that a digit's worth depends on where it sits — was not invented once. Sumerian and then Babylonian scribes wrote numbers in base 60 from roughly the third millennium BCE, using two cuneiform marks, a vertical wedge for one and a chevron for ten, repeated inside each sexagesimal place. For centuries there was no zero: a placeholder sign appears only in later tablets, and before that context alone told 2 from 120. Base 60 outlived the clay it was written on, in every clock face and protractor.

Mesoamerican scribes counted in twenties. Maya Long Count dates, inscribed from around the first century BCE, run 20, then 18 x 20 = 360 rather than 400 in the third place, a deliberate irregularity that brings that place near the length of a year. The Maya did write zero, as a shell glyph.

Binary's European history belongs to Gottfried Wilhelm Leibniz, who published Explication de l'Arithmétique Binaire in 1703. The popular story that the Chinese I Ching gave him the idea runs backwards: Leibniz had worked on base two for years beforehand, and when the Jesuit missionary Joachim Bouvet wrote to him about the 64 hexagrams in 1701, what the letters established was that the I Ching amounted to an independent, parallel invention of binary notation rather than Leibniz's source. Thomas Harriot had investigated binary and other positional systems earlier still, but published none of it; the work was found later among his papers.

Base twelve has had organised advocates: F. Emerson Andrews argued for it in New Numbers (1935), and the Duodecimal Society of America, founded in 1944, survives today as the Dozenal Society of America. Computing settled the argument on base 16 instead, for one reason: 16 is 2^4, so one hexadecimal digit is exactly four bits and two cover a byte. Writing the extra six digits as A through F became the de facto standard from 1966, in the wake of the Fortran IV manual for the IBM System/360.

Tính chất chính

  • In every base b, the digit string "10" means b itself and "100" means b squared.
  • Writing n in base b takes floor(log_b n) + 1 digits, so the smaller the base, the longer the numeral.
  • Base 36 is the largest base writable with the ten digits plus the twenty-six letters of the Latin alphabet, which is where this converter stops.
  • Because 8 = 2^3 and 16 = 2^4, converting between bases 2, 8 and 16 is pure digit grouping — no arithmetic is required.
  • A number is divisible by b - 1 exactly when the sum of its base-b digits is; casting out nines is this rule for b = 10.
  • 1/d in lowest terms terminates in base b only when every prime factor of d divides b, which is why 0.1 cannot be written exactly in binary.
  • Base 1 is not positional at all: with a single digit there is no place value, so unary can only repeat a mark.
  • This page converts with arbitrary-precision integers, so values far past 2^53 - 1 — the largest integer a JavaScript number holds exactly — still convert digit for digit.

Xuất hiện ở đâu

  • Minutes, seconds and the 360 degrees of a circle are inherited directly from Babylonian base 60.
  • The Maya Long Count is base 20 with one deliberate irregularity: its third place counts 18 twenties, giving 360 days rather than 400.
  • URL shorteners and short-ID schemes encode database row numbers in base 36 or base 62 to keep links brief — a convention, not a standard.
  • Punycode, which carries internationalised domain names through ASCII-only systems, uses a 36-symbol digit alphabet (a-z for 0-25, then 0-9 for 26-35); it is widely described as base 36, but its generalised variable-length integers are not a plain positional base.
  • French quatre-vingts for 80 and the Danish counting words are often cited as traces of older base-20 systems; the Celtic-substrate explanation for the French forms is disputed among linguists.

Cách dùng bộ tạo này

Các giá trị được tạo hiện ở trên cùng, bên cạnh là nút sao chép. Để biến chúng thành ảnh, hãy chọn một dáng vẻ trong các kiểu ở phần Tạo ảnh, chọn kích thước xuất rồi tải về dưới dạng PNG, JPEG hoặc WebP. Mọi thứ được vẽ trong trình duyệt, nên không có gì bạn tạo ra được gửi tới máy chủ.

Thanh địa chỉ cập nhật theo lúc bạn làm, nên liên kết luôn cho lại đúng những gì bạn đang thấy — tiện khi muốn chia sẻ một dãy cụ thể hay giữ lại một cấu hình. Dùng Sao chép để lấy giá trị dưới dạng văn bản thuần, hoặc Xuất dữ liệu để có CSV, JSON, NDJSON, SQL và XML.

Nguồn

Các phần tóm lược lịch sử trên trang này dựa vào những tài liệu giấy phép mở được liệt kê ở trên. Thấy chỗ nào sai? Hãy cho chúng tôi biết và chúng tôi sẽ sửa.