Skip to content
Hexadecimal Converter

Hexadecimal Converter

Type in any field — hex, decimal, binary, octal or another base — and every other field follows, exactly.

Type in any field; every base follows.

Bit width

As signed 8-bit: −1

Any base, 2–36
Method: Sum of powers of 16
Each hex digit times its power of 16
DigitValueWeightProduct
F15× 161240
F15× 16015

Add the products: 255.

What is hexadecimal?

Hexadecimal is base 16, written with 0–9 and A–F for ten to fifteen. Type a value into any field of this hex converter — hex, decimal, binary, octal or any base from 2 to 36 — and the others update at once, exact at any length, with two’s complement for negatives and the hand method on request.

Programmers reach for hex because one hex digit is exactly four bits. A byte is always two digits, from 00 to FF, and a 32-bit word is always eight, so a memory address, a color like #1E90FF or a register dump stays short and still lines up with the bits underneath. Decimal hides that structure; binary shows it but runs four times as long.

How to convert hex, decimal, binary and octal

Type the number into the field for its base. There is no From and To to set before you start, and no Convert button. The field you type in becomes the source and the rest become answers. Here the value went in as decimal, so the accent dot sits on DEC and hex is the one to copy.

Bit width

Any base, 2–36
Method: Repeated division by 16
Divide by 16 until the quotient is 0
DivideQuotientRemainderDigit
2024 ÷ 1612688
126 ÷ 16714E
7 ÷ 16077

Read the remainders from the bottom up: 7E8.

Pasting hex with 0x, # or h

Values come with the habits of wherever they were copied from: 0x from C, # from CSS, a trailing h from an assembly listing, underscores from a Rust literal, spaces from a hex dump. The panel removes them and says exactly what it removed, so nothing is reinterpreted behind your back.

Bit width

Read as hex: ignored 2 separators, removed the # prefix, removed the h suffix.

Any base, 2–36
Method: Sum of powers of 16
Each hex digit times its power of 16
DigitValueWeightProduct
11× 1651 048 576
A10× 164655 360
22× 1638192
B11× 1622816
33× 16148
C12× 16012

Add the products: 1 715 004.

Converting large numbers without rounding

Ordinary JavaScript numbers stop being exact above 253, which is why many converters quietly round a 64-bit ID. This one does integer arithmetic on arbitrary-length values, so 2128 − 1 comes out as thirty-two F’s and not a number ending in zeros.

Bit width

Any base, 2–36
Method: Repeated division by 16
Divide by 16 until the quotient is 0
DivideQuotientRemainderDigit
340 282 366 920 938 463 463 374 607 431 768 211 455 ÷ 1621 267 647 932 558 653 966 460 912 964 485 513 21515F
21 267 647 932 558 653 966 460 912 964 485 513 215 ÷ 161 329 227 995 784 915 872 903 807 060 280 344 57515F
1 329 227 995 784 915 872 903 807 060 280 344 575 ÷ 1683 076 749 736 557 242 056 487 941 267 521 53515F
83 076 749 736 557 242 056 487 941 267 521 535 ÷ 165 192 296 858 534 827 628 530 496 329 220 09515F
5 192 296 858 534 827 628 530 496 329 220 095 ÷ 16324 518 553 658 426 726 783 156 020 576 25515F
324 518 553 658 426 726 783 156 020 576 255 ÷ 1620 282 409 603 651 670 423 947 251 286 01515F
20 282 409 603 651 670 423 947 251 286 015 ÷ 161 267 650 600 228 229 401 496 703 205 37515F
1 267 650 600 228 229 401 496 703 205 375 ÷ 1679 228 162 514 264 337 593 543 950 33515F
79 228 162 514 264 337 593 543 950 335 ÷ 164 951 760 157 141 521 099 596 496 89515F
4 951 760 157 141 521 099 596 496 895 ÷ 16309 485 009 821 345 068 724 781 05515F
309 485 009 821 345 068 724 781 055 ÷ 1619 342 813 113 834 066 795 298 81515F
19 342 813 113 834 066 795 298 815 ÷ 161 208 925 819 614 629 174 706 17515F
1 208 925 819 614 629 174 706 175 ÷ 1675 557 863 725 914 323 419 13515F
75 557 863 725 914 323 419 135 ÷ 164 722 366 482 869 645 213 69515F
4 722 366 482 869 645 213 695 ÷ 16295 147 905 179 352 825 85515F
295 147 905 179 352 825 855 ÷ 1618 446 744 073 709 551 61515F
18 446 744 073 709 551 615 ÷ 161 152 921 504 606 846 97515F
1 152 921 504 606 846 975 ÷ 1672 057 594 037 927 93515F
72 057 594 037 927 935 ÷ 164 503 599 627 370 49515F
4 503 599 627 370 495 ÷ 16281 474 976 710 65515F
281 474 976 710 655 ÷ 1617 592 186 044 41515F
17 592 186 044 415 ÷ 161 099 511 627 77515F
1 099 511 627 775 ÷ 1668 719 476 73515F
68 719 476 735 ÷ 164 294 967 29515F
4 294 967 295 ÷ 16268 435 45515F
268 435 455 ÷ 1616 777 21515F
16 777 215 ÷ 161 048 57515F
1 048 575 ÷ 1665 53515F
65 535 ÷ 16409515F
4095 ÷ 1625515F
255 ÷ 161515F
15 ÷ 16015F

Read the remainders from the bottom up: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.

Negative hex numbers and two’s complement

The bits FFFFFFFF mean 4,294,967,295 or −1 depending on how many bits you assume. Pick a width and the panel reads the pattern in two’s complement: decimal shows the signed value, and the unsigned reading stays one line below it. With Any selected, a value whose top bit is set gets a suggestion, never a silent reinterpretation.

Bit width

Read as hex: ignored 1 separator, removed the 0x prefix.

Unsigned: 4 294 967 295

Any base, 2–36
Method: Sum of powers of 16
Each hex digit times its power of 16
DigitValueWeightProduct
F15× 1674 026 531 840
F15× 166251 658 240
F15× 16515 728 640
F15× 164983 040
F15× 16361 440
F15× 1623840
F15× 161240
F15× 16015

Add the products: 4 294 967 295.

As a signed 32-bit value the top bit is set, so subtract 232: 4 294 967 295 − 4 294 967 296 = −1.

Converting fractions between bases

One tenth has no finite form in base 16; it is 0.1999… forever. The panel finds the repeating block and puts it in brackets, which you can paste back in. An expansion that would run past 64 digits is cut there and labelled as truncated instead of being rounded.

Bit width

Widths apply to whole numbers.

Repeats forever: 0.19

Repeats forever: 0.00011

Repeats forever: 0.06314

Any base, 2–36
Method: Repeated division by 16

The whole part is 0, so the hex number starts 0.

Multiply the fraction by 16 and keep the whole part
MultiplyProductDigit
0.1 × 161.61
0.6 × 169.69

The row 0.6 comes back, so the digits from there repeat forever.

Seeing the conversion steps

Under every panel there is a working for the current value: each digit times its power of 16, each division with its remainder, each nibble written out. It stays closed until you ask, and it follows the field you typed in.

Bit width

Any base, 2–36
Method: Sum of powers of 16
Each hex digit times its power of 16
DigitValueWeightProduct
22× 1638192
A10× 1622560
F15× 161240
33× 1603

Add the products: 10 995.

One page per conversion

How positional bases work

Every base on this page is positional: a digit’s worth depends on where it stands. In decimal the places are ones, tens, hundreds; in hex they are ones, sixteens, two-hundred-fifty-sixes; in binary ones, twos, fours, eights. A number is the sum of each digit times its place value, and that is all any conversion has to preserve.

Going from another base into decimal means adding up those products. Going out of decimal means the reverse: divide by the new base again and again, and the remainders are the digits, last one first. Between binary, octal and hex there is a shortcut because 8 and 16 are powers of 2. Each octal digit is three bits and each hex digit four, so you can swap digits for bit groups without any arithmetic.

Bases above ten borrow letters. Hex uses A–F for ten to fifteen, and base 36 runs all the way to Z, which is why short links and some IDs are written in it. Letters are read the same in upper or lower case.

Questions people ask

How do you convert hexadecimal?

Each hex digit is worth 16 times the digit to its right. To get decimal, multiply every digit by its power of 16 and add the products; to go the other way, divide by 16 repeatedly and read the remainders backwards. For binary, swap each hex digit for its four bits.

What does FF mean in hex?

FF is the largest two-digit hex value: 15 × 16 + 15 = 255, or 11111111 in binary. It is the maximum value of one byte, which is why it marks a full color channel in #FF0000 and a full byte mask in code.

What does B mean in hex?

B stands for 11. Hex uses the letters A to F for the values 10 to 15, so B is 11 and B0 is 11 × 16 = 176.

Is hexadecimal the same as hex?

Yes. Hex is short for hexadecimal, the base-16 number system, so there is nothing to convert. Markers such as 0x, # or a trailing h only label a number as hex; the converter removes them and tells you it did.

How are negative numbers written in hex?

Computers store them in two’s complement at a fixed width. At 8 bits, −1 is FF and −128 is 80; at 32 bits, −1 is FFFFFFFF. Choose a width and the converter shows the bit pattern in hex, binary and octal and the signed value in decimal.

Can the converter handle fractions?

Yes. Repeating fractions show the repeating digits in brackets, so 0.1 in decimal is 0.1(9) in hex. An expansion longer than 64 digits is cut off and labelled as truncated, never silently rounded.

Last updated