Base12 to Hex Converter

Base12 to Hex Converter. Enter your value into Base12 (Duodecimal) Input and the Base12 to Hex Converter instantly returns its Hex Output. Developers testing bit-shifting logic can verify their expected output against the hex shift calculator before committing code.

Converting a dozenal value by hand is slow, so this guide gives you a dependable method and a finished result you can reuse. Treat it as a base12 to hex converter checklist: write the value in base-12, turn it into a decimal total, then rewrite that total in hexadecimal. By the end you will see that 3A7B in base-12 equals 1A3F in hex.

Base12 to Hex Converter Basics: Duodecimal Meets Hex

Every base12 to hex converter rests on one idea: a number is a sum of symbols multiplied by powers of a radix. In base-12 the radix is twelve, and in hex it is sixteen. Both systems rely on positional notation, so the same written pattern means different amounts depending on the base you read it in. Twelve and sixteen share only the factor four, so you cannot swap characters one-for-one the way you can between binary and hex. The reliable route passes through an ordinary decimal total. Use the text to utf-8 hex converter when you need byte-level hex output rather than simple character codes, especially for multi-byte characters.

What the dozenal numeral system looks like

The base-12 numeral system counts in dozens. It needs twelve symbols: the digits 0 to 9 plus A for ten and B for eleven. Twelve is divisible by 2, 3, 4 and 6, which is why a dozen eggs splits cleanly and why a clock face is cut into twelve hours. The same property made the base popular in commerce and in traditional measurement.

Hexadecimal (base-16) in digital systems

Hexadecimal is the base-16 numeral system that digital hardware favours. It uses the digits 0 to 9 plus the letters A through F for the values ten to fifteen, written in uppercase by convention. One hex digit stores exactly four bits, a unit often called a nibble, so two hex characters fill one byte. That tidy fit with binary is why programmers prefer hex to any other base above ten.

Convert Base-12 to Hexadecimal: Two Conversion Methods

There are two approaches worth knowing, and both use a decimal intermediary. Decimal is simply the one base whose arithmetic you already do without thinking, so it makes a safe bridge between twelve and sixteen.

Method 1: add up each positional value

Number the characters from the right, starting at zero. Each one contributes its own value times 12 raised to its position, and the contributions add up to a decimal equivalent. The positional value of the leftmost place grows fast, so keep the powers of 12 in view: 1, 12, 144, 1,728, 20,736.

$$N_{10} = \sum_{i=0}^{k} d_i \times 12^{i}$$

Here \(d_i\) is the symbol at position \(i\), with A read as 10 and B read as 11. If you prefer a running total, the positional calculation can be done without writing any powers: multiply the total so far by 12, add the next digit, and repeat until you run out of characters.

Method 2: divide by 16 and collect remainders

Now rewrite the decimal total in sixteens. Divide by 16 repeatedly and note the leftovers. Every leftover becomes one hex character, and the first leftover you produce is the last character of the answer. Stop when the quotient reaches zero, then read the remainders from bottom to top. This is the standard decimal to hex routine, and it works for any positive whole number.

$$N_{10} = 16q + r, \quad 0 \le r \le 15$$

Base 12 to Hex Walkthrough: Converting 3A7B

Take 3A7B in base-12. It is a four-place value with two ordinary numerals and one letter in the middle, which makes it a good test for any base 12 to hex converter or either approach.

Step 1: turn 3A7B into a decimal total

Multiply each symbol by its power of 12 (a basic calculator helps with the larger products) and add the contributions together:

Step 1: turn 3A7B into a decimal total
Place (from left)Symbol valuePower of 12Contribution
33123 = 1,7285,184
A10122 = 1441,440
77121 = 1284
B11120 = 111
Decimal total6,719
$$3 \times 1728 + 10 \times 144 + 7 \times 12 + 11 = 6719$$
Waterfall chart showing the base-12 number 3A7B built from place values 5,184, 1,440, 84 and 11 to reach a decimal total of 6,719
The four place contributions of 3A7B in base-12 add up to a decimal total of 6,719.

Step 2: divide 6,719 by 16

Work down the list, keeping each leftover:

  1. 6,719 ÷ 16 = 419 with remainder 15, written F
  2. 419 ÷ 16 = 26 with remainder 3, written 3
  3. 26 ÷ 16 = 1 with a leftover of 10, written A
  4. 1 ÷ 16 = 0 with a leftover of 1, written 1

Reading the leftovers from the last division up to the first gives 1A3F. So 3A7B in base-12 is 1A3F in hexadecimal.

Step 3: check the result in binary

Each hex character maps to a four-bit group: 1 is 0001, A is 1010, 3 is 0011 and F is 1111. Joined together, 1A3F is 0001 1010 0011 1111 in binary (base-2), a 16-bit pattern that equals 6,719 in base-10. If the pattern does not add back to 6,719, one of the divisions went wrong.

Diagram splitting hex 1A3F into four-bit binary groups 0001, 1010, 0011 and 1111 that sum back to 6,719
Each hex character of 1A3F expands to a four-bit group, a quick binary check on the converted result.

Base-12 to Hex Reference Table and Character Mapping

This reference table shows round base-12 values next to their decimal, hex and binary forms, so you can sanity-check a result at a glance. Notice how 100 in base-12 is one gross, 144 in decimal, which lands on the tidy hex value 90. The hex to base32 converter encodes the bytes from a hex string using standard RFC 4648 Base32.

Base-12 to Hex Reference Table and Character Mapping
Base-12DecimalHexadecimalBinary
1012C1100
20241811000
303624100100
6072481001000
1001449010010000
200288120100100000
10001,7286C011011000000
BBB1,7276BF11010111111

Single-digit, two-digit and three-digit examples

Short inputs follow the same rules, only with fewer steps:

  • Values from 0 to B need no work at all: the characters carry the same value in both bases, so B in base-12 is B in hex.
  • For 9B, compute 9 × 12 + 11 = 119, which is 77 in hex.
  • For A05, compute 10 × 144 + 0 + 5 = 1,445, and dividing by 16 twice gives 5A5.

The comparison below shows why the two bases behave so differently when you convert:

Single-digit, two-digit and three-digit examples
PropertyBase-12Hexadecimal
Base value1216
Characters0-9, A, B0-9, A-F
Information per characterabout 3.58exactly 4
Divisible by2, 3, 4, 62, 4, 8
Typical homeCounting in dozens, time, tradeComputing and electronics

Hexadecimal to Base-12 and Fractions

Everything above can be run backwards, and fractions need slightly different handling.

Reverse direction: hex to decimal, then divide by 12

To go back, expand the hex value into a decimal total (hex to decimal) and divide repeatedly by 12 instead of 16. For 1A3F the total is 6,719. Dividing gives 559 with a leftover of 11 (B), then 46 with 7, then 3 with 10 (A), then 0 with 3. Reading upward returns 3A7B, the value you started with, which is also a useful check on the forward result.

Handling fractional parts

Fractional parts use multiplication, not division. Multiply the fraction by 16, take the whole number as the next hex character, and repeat with what is left. As an example, 0.4 in base-12 is 4 ÷ 12, or one third in decimal. Multiplying one third by 16 gives 5 with one third still left over, so the hex expansion is 0.5555… and never ends. A fraction that stops cleanly in one base can repeat forever in another, so decide how many places you need before trusting the output.

Mapping a Base-12 Glyph ID to a Hex Code Point

Noor is drawing a small base-12 numeral font, and she numbers her glyph slots in base-12 because that is how her sketchbook pages are counted. Before exporting, she needs each slot's Unicode code point, and font editors expect those in hexadecimal. The slot for her symbol for ten is 4B76.

She works through the base-12 to hexadecimal conversion one place at a time: 4 × 1,728 = 6,912, B (11) × 144 = 1,584, 7 × 12 = 84 and 6 × 1 = 6, for a total of 8,586. Dividing by 16 gives 536 with a leftover of 10 (A), then 33 with 8, then 2 with 1, then 0 with 2. Reading upward, the code point is 218A.

Now she checks it against a named reference. The Unicode Number Forms block lists U+218A as the turned two, one of two characters Unicode 8.0 added for base-12 numerals. The next slot, 4B77, comes out as 8,587 in decimal, which is 218B, the turned three, the symbol for eleven. Both match the standard, so her slot numbering is lined up.

The result tells her exactly what to do next. She maps slots 4B76 and 4B77 to U+218A and U+218B in the editor and leaves every other numeral at plain 0 to 9. Out of curiosity she enters 4B78, which gives 218C, a code point the block leaves unassigned, so she stops at two glyphs instead of drawing a third that no application would display.

Programming Duodecimal Conversion: Algorithm and Input Validation

In programming, the same two-stage approach becomes a short loop. Keep it simple and test it against the 3A7B result above.

Pseudocode for the conversion steps

function base12ToHex(text):
  total = 0
  for each char c in text:
    total = total * 12 + valueOf(c)   // 0-9, A=10, B=11
  if total == 0: return "0"
  out = ""
  while total > 0:
    out = hexChar(total mod 16) + out
    total = total div 16
  return out

Checking characters and overflow

Input validation comes first. Reject any character outside 0-9, A and B, and normalise lowercase letters to uppercase so that a and A mean the same thing. Long inputs can exceed a 64-bit integer, so use an arbitrary-precision type for them. Floating-point types are fine for small fractions, but they lose accuracy quickly. Many languages also let you display the result with a 0x prefix, such as 0x1A3F, which marks it as a hex literal rather than a decimal value.

Real-World Uses of Hex and Duodecimal Counting

Hex shows up wherever people need a compact view of binary data, while base-12 survives mostly in everyday counting.

Computing and blockchain

In computer science, one byte is always two hex characters, which keeps long values readable. A hash such as a 256-bit digest appears as 64 hex characters, and blockchain explorers show transaction IDs and addresses the same way. If a source writes a value in base-12, you convert it to hex before it can be used in any of these contexts. Other places you will meet it:

  • Memory addresses in debuggers and system logs
  • Color codes in web design, with two characters per channel
  • Machine code listings and opcode references
  • Network packets and blockchain scripts
  • Raw dumps, where each byte appears as a hex pair

Octal still appears in Unix file permissions, but hex covers nearly every other case, and each of these number systems trades readability against length.

Mathematics and number theory

In mathematics, base-12 is a favourite example for explaining why divisibility depends on the base you write a number in. Study in number theory compares how fractions terminate in different bases, which is exactly the effect you saw with 0.4 above. A general unit converter page rarely explains any of this, which is why a worked method like the one here is worth keeping.

Cross-Verification of Base-12 to Hex Results

Most wrong answers come from a small set of slips, and every one of them can be caught with a quick cross-verification.

  • Reading A or B as a letter rather than the values ten and eleven
  • Using powers of 16 when expanding a base-12 number, or powers of 12 when dividing
  • Reading the leftovers from top to bottom instead of bottom to top
  • Stopping the division before the quotient reaches zero

A final check takes seconds: convert your hex answer back to base-12 and compare it with the original, or add the binary groups and confirm the decimal total. For a result you plan to publish or ship in code, run the same input through a second tool before you rely on it.