Number System Conversion: Binary, Octal, Decimal and Hexadecimal
Number system conversion rewrites the same value in a different base: 45 in decimal is 101101 in binary, 55 in octal and 2D in hex. The value does not change; only the digits and their place values do.
This page explains what a base is, how position gives each digit its weight, and the two methods that convert any base to any other.
It covers numbers, not character codes. For the codes behind letters, binary code explained from the alphabet up takes this further.
What is number system conversion?
Converting a number between bases changes how you write a value, not what the value is worth. A base is the count of distinct digits a system uses, and it sets what each position is worth. Change the base and the digits change with it, while the quantity underneath them holds still.
A price tag reading 45 and a switch pattern reading 101101 describe one quantity in two notations, in the way a distance is the same whether you write it in miles or kilometres. Conversion is a translation between notations, so a converter that altered the value would break the only rule the operation has.
One value in four bases, from the same digits: 101101 in binary is 45 in decimal, 0o55 in octal and 0x2D in hex. Read that row in either direction and the arithmetic is the same.
The same conversion code writes every worked example on this page.
What are the binary, octal, decimal and hexadecimal number systems?
Binary, octal, decimal and hexadecimal are four positional number systems, using 2, 8, 10 and 16 digits. Each of them writes a value as digits whose place values are powers of its own base, and only the base itself differs.
Binary is the machine's own notation, octal packs three bits into a digit, and hexadecimal packs four. Each profile below gives the same facts in the same order.
Binary (base 2)
Binary is base 2, the system a circuit can hold directly. Its digits are 0, 1 and nothing else, so each position is worth twice the one to its right: position n is worth 2^n, which gives the low weights 16, 8, 4, 2, 1. A binary value carries the prefix 0b in prose, as in 0b1010, or a subscript on paper, as in 1010₂.
Width comes from the hardware rather than the value. Eight bits make a byte and cover 0–255; four bits make a nibble and cover 0–15. You meet binary in logic gates, registers, subnet masks, bit flags.
Why do computers use binary?
Two states are the only thing a circuit can hold reliably.
A wire that sits either high or low survives noise, voltage drift and the spread between one manufactured part and the next, because the gap between the two states is wide. Ten voltage levels would have to be told apart on every gate, at every temperature, for the life of the part. Binary trades digit count for certainty: values get longer, and the hardware reading them stops guessing.
Octal (base 8)
Octal is base 8, and its digits run 0–7. Position n is worth 8^n, so the low weights are 4096, 512, 64, 8, 1. An octal value carries the prefix 0o in prose, as in 0o17, and C and several shells write a leading zero instead, as in 017.
Its widths follow from that: 3 digits cover a byte (000–377); Unix permissions 000–777. You meet octal in chmod 755, file modes, escape sequences. In chmod 755 each digit carries the read, write and execute bits for one class of user, three bits at a time.
Decimal (base 10)
Decimal is base 10, with digits 0–9 and position n worth 10^n, giving the weights 10000, 1000, 100, 10, 1. It needs no prefix, because it is what a reader assumes; a page that has to be explicit writes a subscript, as in 17₁₀. It has no fixed width; a page working in bytes treats 0–255 as its range.
Decimal is also the odd one out. Ten is not a power of two, so the bits per decimal digit come out not integral (~3.32). That number is why decimal has no shortcut into binary. You meet decimal in everyday arithmetic, ASCII code lists.
Hexadecimal (base 16)
Hexadecimal is base 16. Its digit set is 0–9, A–F (A=10 … F=15; case-insensitive), which is where the letters come from. Position n is worth 16^n, so the low weights are 65536, 4096, 256, 16, 1. A hex value carries the prefix 0x in prose, as in 0x1F, and a leading # when it names a colour.
Hex is built around the byte: 2 digits cover a byte (00–FF); 6 digits = RGB colour; 8 digits = 32-bit word. You meet it in memory addresses, colour codes, MAC addresses, hex dumps, error codes. Two digits per byte, with no digit ever straddling a byte boundary, is what makes hexadecimal the usual shorthand for a run of bits.
What digits does each number system use?
A base with radix b uses exactly b digits, running from 0 to b − 1.
Binary has 2, octal has 8, decimal has 10 and hexadecimal has 16: 0–9, A–F (A=10 … F=15; case-insensitive). Those six letters are digits, not labels — A is worth ten in the way 9 is worth nine, and it takes its place value the same way. A digit above the set is not bad arithmetic but bad reading: 8 cannot appear in an octal value, and 2 cannot appear in a binary one. The table gives each system's digits, its largest digit and how many distinct digits it holds.
| Number system | Digits | Largest digit | Distinct digits | Bits per digit | Place value | Place values | Typical range | Typical use | Power of two |
|---|---|---|---|---|---|---|---|---|---|
| Binary (base 2) | 0, 1 | 1 | 2 | 1 | 2^n | 16, 8, 4, 2, 1 | 8-bit byte 0–255 (00000000–11111111); 4-bit nibble 0–15; 16/32/64-bit words | logic gates, registers, subnet masks, bit flags | yes |
| Octal (base 8) | 0–7 | 7 | 8 | 3 | 8^n | 4096, 512, 64, 8, 1 | 3 digits cover a byte (000–377); Unix permissions 000–777 | chmod 755, file modes, escape sequences | yes |
| Decimal (base 10) | 0–9 | 9 | 10 | not integral (~3.32) | 10^n | 10000, 1000, 100, 10, 1 | any; decimal pages treat 0–255 as the byte range | everyday arithmetic, ASCII code lists | no |
| Hexadecimal (base 16) | 0–9, A–F (A=10 … F=15; case-insensitive) | 15 | 16 | 4 | 16^n | 65536, 4096, 256, 16, 1 | 2 digits cover a byte (00–FF); 6 digits = RGB colour; 8 digits = 32-bit word | memory addresses, colour codes, MAC addresses, hex dumps, error codes | yes |
What is positional weight (place value) in a number system?
Positional weight is what a digit is worth because of where it sits.
The rule is one line: a digit contributes digit × base^position, with position counted from 0 at the right-hand end. In decimal the low weights run 10000, 1000, 100, 10, 1; in binary 16, 8, 4, 2, 1; in hex 65536, 4096, 256, 16, 1. Nothing else in a conversion is new. Both universal methods below apply that one rule, one of them forwards and one backwards.
Write the place values above the digits and the arithmetic reads itself. Take the binary value 101101, whose place values run 32, 16, 8, 4, 2, 1 from the left:
Result: 101101 = 45
| n | 2ⁿ | Value | Max at n bits |
|---|---|---|---|
| 0 | 2⁰ | 1 | 0 |
| 1 | 2¹ | 2 | 1 |
| 2 | 2² | 4 | 3 |
| 3 | 2³ | 8 | 7 |
| 4 | 2⁴ | 16 | 15 |
| 5 | 2⁵ | 32 | 31 |
| 6 | 2⁶ | 64 | 63 |
| 7 | 2⁷ | 128 | 127 |
| 8 | 2⁸ | 256 | 255 |
| 9 | 2⁹ | 512 | 511 |
| 10 | 2¹⁰ | 1024 | 1023 |
| 11 | 2¹¹ | 2048 | 2047 |
| 12 | 2¹² | 4096 | 4095 |
| 13 | 2¹³ | 8192 | 8191 |
| 14 | 2¹⁴ | 16384 | 16383 |
| 15 | 2¹⁵ | 32768 | 32767 |
| 16 | 2¹⁶ | 65536 | 65535 |
Add the products of the digits that are 1: 32 + 8 + 4 + 1 = 45.
Every power row on this site is laid out that way — the weights above, the digits below as cells that are inked or blank, and the products added in the line underneath. A reader who can build that row can convert a value in any base without a tool, which is the reason to learn it once, here.
What do the prefixes 0b, 0o and 0x mean?
0b marks binary, 0o octal, 0x hexadecimal; a leading # marks a hex colour. Hexadecimal is not case-sensitive (FF = ff); iToolHub writes hex digits in uppercase.
- Binary (base 2)
- Prefix
0b - Subscript
1010₂ - Other forms0b1010 / 1010₂ / suffix b / % (assemblers)
- Octal (base 8)
- Prefix
0o - Subscript
17₈ - Other forms0o17 / leading 0 in C (017) / 17₈ / \017 escape
- Decimal (base 10)
- Prefix
none (default) - Subscript
17₁₀ - Other formsnone (default) / 17₁₀ / suffix d (assemblers)
- Hexadecimal (base 16)
- Prefix
0x - Subscript
1F₁₆ - Other forms0x1F / #1F (colours) / &H1F (BASIC) / suffix h / 1F₁₆ / \x1F escape / U+001F
A prefix exists because the digits alone are ambiguous. The value 41 is a legal decimal number, a legal hex number worth 65, and not a binary number at all, because 4 is not a binary digit. A value pasted without its prefix leaves the base to be guessed, which is why every converter here names its source base in its own title.
Older notations sit alongside the modern ones. C and several shells mark octal with a leading zero, so 017 and 0o17 carry the same value. Textbooks use a subscript instead, which is unambiguous on paper and awkward to type, and assembler dialects use a trailing letter. This site writes the prefix in prose and drops it inside a table, where the column heading already says which base the column holds.
What are a bit, a nibble, a byte and a word?
A byte is 8 bits and holds 256 values, 0–255; a nibble is 4 bits.
Widths decide two things: how a value is padded, and where it stops. A bit is one binary digit. Three bits make the group one octal digit stands for, four bits make a nibble, which is what one hex digit stands for, and eight bits make a byte. A 16-bit word is two bytes and a 32-bit word is four.
| Unit | Width in bits | Distinct values | Unsigned range |
|---|---|---|---|
| bit | 1 | 2 | 0–1 |
| bit triple (one octal digit) | 3 | 8 | 0–7 |
| nibble (one hex digit) | 4 | 16 | 0–15 |
| byte | 8 | 256 | 0–255 |
| 16-bit word | 16 | 65536 | 0–65535 |
| 32-bit word | 32 | 4294967296 | 0–4294967295 |
Padding follows the width rather than the value, so 101101 written into a byte-wide column becomes 00101101, and a character code written in octal takes three digits. iToolHub's text-to-binary and text-to-hex converters write one 8-bit byte per character, separated by spaces.
An 8-bit byte holds 0–255 unsigned; read the same eight bits as a signed value and the range becomes −128 to 127 — how to write a negative number in binary takes this further.
Where character codes fit — and where this page stops
This page converts numbers between bases. A letter is not a number until a table says which number it is, and that lookup is a different mechanism.
A letter becomes a number first; the base comes after: look up any ASCII code from 0 to 127. Above code 127 one character stops being one byte, which is why one character can become several bytes. Character codes are a separate step; to turn text into binary code, the converter shows each byte.
How do you convert decimal to any base with repeated division?
Repeated division is the method that turns a decimal value into any other base.
You divide by the target base, keep the remainder, and repeat on the quotient until nothing is left. The remainders are the digits of the answer, and they arrive backwards: the first remainder is the last digit. That is the step most people miss.
- Divide the decimal value by the target base.
- Write down the remainder; carry the quotient to the next line.
- Repeat until the quotient is 0.
- Read the remainders from bottom to top.
Take 156 into base 2. Each line divides the previous quotient by 2 and records what is left over:
| Division | Quotient | Remainder |
|---|---|---|
| 156 ÷ 2 | 78 | 0 |
| 78 ÷ 2 | 39 | 0 |
| 39 ÷ 2 | 19 | 1 |
| 19 ÷ 2 | 9 | 1 |
| 9 ÷ 2 | 4 | 1 |
| 4 ÷ 2 | 2 | 0 |
| 2 ÷ 2 | 1 | 0 |
| 1 ÷ 2 | 0 | 1 |
Reading the remainder column from the bottom line to the top gives eight digits. Result: 156 = 10011100
The same seed and the same method give the other two bases. Dividing by 8 leaves the remainders 4, 3 and 2, so 156 is 0o234 in octal. Dividing by 16 leaves 12 and 9, and a remainder of 12 is the digit C, because a remainder is a digit in the target base and 10 to 15 are written A to F. A remainder is always smaller than the base you divided by, which is exactly what makes it a digit of that base. Result: 156 = 10011100 = 0o234 = 0x9C
Applied to a single pair this becomes convert decimal to binary. The same ladder run in base 8 is how to change decimal to octal by dividing by 8, and to write a number in base 16 you divide by 16 and name each remainder.
How do you convert any base to decimal with positional expansion?
Positional expansion is the method that turns a value in any base back into decimal.
You write each digit's place value above it, multiply, and add the products. It is the inverse of repeated division, and this section runs the same seed in the opposite direction on purpose: the two sections check each other, and a reader who works both by hand has proved the pair rather than trusting it.
- Write the place values above the digits, right to left, starting at base⁰.
- Multiply each digit by its place value.
- Add the products.
Take 10011100, the value the ladder above produced. Every place value is twice the one to its right, so the top row of the block below is the powers of two in descending order:
Result: 10011100 = 156
Only the digits that are 1 contribute, so the sum is 128 + 16 + 8 + 4, and the inked cells are the ones being added.
The other two bases work the same way with their own weights. In octal the place values are 64, 8, 1, so 0o234 expands to 2 × 64 + 3 × 8 + 4. In hex they are 16, 1, so 0x9C expands to 9 × 16 + 12, taking C as 12. Both land on 156, which is the check the pair exists for.
Applied to a single pair this becomes work out the decimal value of a binary number, with octal to decimal calculator with the working shown and hex to decimal by positional expansion for the other two starting bases.
Why can binary be grouped into octal and hex digits?
One hexadecimal digit equals exactly 4 bits (16 = 2⁴); one octal digit equals exactly 3 bits (8 = 2³). Hex and octal are therefore converted by grouping bits, and hex ↔ octal passes through binary.
The reason is the ratio. A base that is a power of two divides a bit string evenly, so each digit owns a whole number of bits and no digit straddles a boundary. Ten is not a power of two, and the bits per decimal digit come out not integral (~3.32) — the number planted in the decimal profile above. That is why decimal has to divide or multiply its way across, while octal and hex only re-cut the bits.
The two maps below are the entire shortcut: one hex digit reads off the first, one octal digit off the second.
| Hex digit | Decimal | Binary (4-bit) | Octal |
|---|---|---|---|
| 0 | 0 | 0000 | 0 |
| 1 | 1 | 0001 | 1 |
| 2 | 2 | 0010 | 2 |
| 3 | 3 | 0011 | 3 |
| 4 | 4 | 0100 | 4 |
| 5 | 5 | 0101 | 5 |
| 6 | 6 | 0110 | 6 |
| 7 | 7 | 0111 | 7 |
| 8 | 8 | 1000 | 10 |
| 9 | 9 | 1001 | 11 |
| A | 10 | 1010 | 12 |
| B | 11 | 1011 | 13 |
| C | 12 | 1100 | 14 |
| D | 13 | 1101 | 15 |
| E | 14 | 1110 | 16 |
| F | 15 | 1111 | 17 |
| Octal digit | Decimal | Binary (3-bit) |
|---|---|---|
| 0 | 0 | 000 |
| 1 | 1 | 001 |
| 2 | 2 | 010 |
| 3 | 3 | 011 |
| 4 | 4 | 100 |
| 5 | 5 | 101 |
| 6 | 6 | 110 |
| 7 | 7 | 111 |
Grouping starts at the right-hand end, where the place values line up, and the leftmost group takes zeros when it comes up short. Take 1010111100: in threes from the right that is 001 010 111 100, and those groups name 1, 2, 7 and 4. Result: 1010111100 = 0o1274
Four bits at a time in one direction — change binary into hex four bits at a time — and four bits out in the other, convert hexadecimal to binary. Three bits at a time gives convert binary to octal, and convert octal to binary runs it in reverse.
How do you convert between octal and hex?
There is no direct digit map between octal and hex, so the bits are the bridge.
Eight and sixteen are not powers of each other, so no octal digit lines up with a hex digit. Both are powers of two, though, so both map cleanly onto bits: one octal digit is three, one hex digit is four. Lay the bits out in a single row and re-cut them at the other width.
- Replace each source digit with its bits — four for a hex digit, three for an octal digit.
- Join the bits into one string, then regroup from the right into threes (for octal) or fours (for hex); a short leftmost group takes leading zeros, which drop out of the answer.
- Name each group with one digit of the target base.
Forward, out of hex: 2F spreads to 0010 1111 by the hex map, and regrouping from the right into threes gives 00 101 111, which names 5 and 7. Result: 2F = 00101111 = 0o57
Back, out of octal: 472₈ spreads to 100 111 010 by the octal map, and regrouping into fours from the right gives 1 0011 1010, which names 1, 3 and A. Result: 472₈ = 100111010 = 0x13A
The slower route runs through decimal: expand the source, then divide back out. It reaches the same answer and puts back the arithmetic the shortcut avoids, so keep it as a check rather than a method.
Applied to a single pair this becomes change a hex number into octal via binary, and change an octal number into hex goes the other way. Those two pages carry the padding edge cases.
What is the number system conversion table (0-255 in all four bases)?
The table below holds every value a byte can carry, written in all four bases at once.
Read a row across: the decimal value, then the same value in eight binary digits, in three octal digits and in two hex digits, padded by the conventions set out above. Rows 0 to 31 sit open and the rest continue underneath them, and every row carries its own anchor, so one value can be linked to directly. Use it to check work done by hand, or to read a byte out of a hex dump without running the arithmetic again. Every row comes from the same conversion code as the worked examples above.
| Decimal | Binary (8-bit) | Octal | Hexadecimal |
|---|---|---|---|
| 0 | 00000000 | 000 | 00 |
| 1 | 00000001 | 001 | 01 |
| 2 | 00000010 | 002 | 02 |
| 3 | 00000011 | 003 | 03 |
| 4 | 00000100 | 004 | 04 |
| 5 | 00000101 | 005 | 05 |
| 6 | 00000110 | 006 | 06 |
| 7 | 00000111 | 007 | 07 |
| 8 | 00001000 | 010 | 08 |
| 9 | 00001001 | 011 | 09 |
| 10 | 00001010 | 012 | 0A |
| 11 | 00001011 | 013 | 0B |
| 12 | 00001100 | 014 | 0C |
| 13 | 00001101 | 015 | 0D |
| 14 | 00001110 | 016 | 0E |
| 15 | 00001111 | 017 | 0F |
| 16 | 00010000 | 020 | 10 |
| 17 | 00010001 | 021 | 11 |
| 18 | 00010010 | 022 | 12 |
| 19 | 00010011 | 023 | 13 |
| 20 | 00010100 | 024 | 14 |
| 21 | 00010101 | 025 | 15 |
| 22 | 00010110 | 026 | 16 |
| 23 | 00010111 | 027 | 17 |
| 24 | 00011000 | 030 | 18 |
| 25 | 00011001 | 031 | 19 |
| 26 | 00011010 | 032 | 1A |
| 27 | 00011011 | 033 | 1B |
| 28 | 00011100 | 034 | 1C |
| 29 | 00011101 | 035 | 1D |
| 30 | 00011110 | 036 | 1E |
| 31 | 00011111 | 037 | 1F |
Show 32 to 255
| Decimal | Binary (8-bit) | Octal | Hexadecimal |
|---|---|---|---|
| 32 | 00100000 | 040 | 20 |
| 33 | 00100001 | 041 | 21 |
| 34 | 00100010 | 042 | 22 |
| 35 | 00100011 | 043 | 23 |
| 36 | 00100100 | 044 | 24 |
| 37 | 00100101 | 045 | 25 |
| 38 | 00100110 | 046 | 26 |
| 39 | 00100111 | 047 | 27 |
| 40 | 00101000 | 050 | 28 |
| 41 | 00101001 | 051 | 29 |
| 42 | 00101010 | 052 | 2A |
| 43 | 00101011 | 053 | 2B |
| 44 | 00101100 | 054 | 2C |
| 45 | 00101101 | 055 | 2D |
| 46 | 00101110 | 056 | 2E |
| 47 | 00101111 | 057 | 2F |
| 48 | 00110000 | 060 | 30 |
| 49 | 00110001 | 061 | 31 |
| 50 | 00110010 | 062 | 32 |
| 51 | 00110011 | 063 | 33 |
| 52 | 00110100 | 064 | 34 |
| 53 | 00110101 | 065 | 35 |
| 54 | 00110110 | 066 | 36 |
| 55 | 00110111 | 067 | 37 |
| 56 | 00111000 | 070 | 38 |
| 57 | 00111001 | 071 | 39 |
| 58 | 00111010 | 072 | 3A |
| 59 | 00111011 | 073 | 3B |
| 60 | 00111100 | 074 | 3C |
| 61 | 00111101 | 075 | 3D |
| 62 | 00111110 | 076 | 3E |
| 63 | 00111111 | 077 | 3F |
| 64 | 01000000 | 100 | 40 |
| 65 | 01000001 | 101 | 41 |
| 66 | 01000010 | 102 | 42 |
| 67 | 01000011 | 103 | 43 |
| 68 | 01000100 | 104 | 44 |
| 69 | 01000101 | 105 | 45 |
| 70 | 01000110 | 106 | 46 |
| 71 | 01000111 | 107 | 47 |
| 72 | 01001000 | 110 | 48 |
| 73 | 01001001 | 111 | 49 |
| 74 | 01001010 | 112 | 4A |
| 75 | 01001011 | 113 | 4B |
| 76 | 01001100 | 114 | 4C |
| 77 | 01001101 | 115 | 4D |
| 78 | 01001110 | 116 | 4E |
| 79 | 01001111 | 117 | 4F |
| 80 | 01010000 | 120 | 50 |
| 81 | 01010001 | 121 | 51 |
| 82 | 01010010 | 122 | 52 |
| 83 | 01010011 | 123 | 53 |
| 84 | 01010100 | 124 | 54 |
| 85 | 01010101 | 125 | 55 |
| 86 | 01010110 | 126 | 56 |
| 87 | 01010111 | 127 | 57 |
| 88 | 01011000 | 130 | 58 |
| 89 | 01011001 | 131 | 59 |
| 90 | 01011010 | 132 | 5A |
| 91 | 01011011 | 133 | 5B |
| 92 | 01011100 | 134 | 5C |
| 93 | 01011101 | 135 | 5D |
| 94 | 01011110 | 136 | 5E |
| 95 | 01011111 | 137 | 5F |
| 96 | 01100000 | 140 | 60 |
| 97 | 01100001 | 141 | 61 |
| 98 | 01100010 | 142 | 62 |
| 99 | 01100011 | 143 | 63 |
| 100 | 01100100 | 144 | 64 |
| 101 | 01100101 | 145 | 65 |
| 102 | 01100110 | 146 | 66 |
| 103 | 01100111 | 147 | 67 |
| 104 | 01101000 | 150 | 68 |
| 105 | 01101001 | 151 | 69 |
| 106 | 01101010 | 152 | 6A |
| 107 | 01101011 | 153 | 6B |
| 108 | 01101100 | 154 | 6C |
| 109 | 01101101 | 155 | 6D |
| 110 | 01101110 | 156 | 6E |
| 111 | 01101111 | 157 | 6F |
| 112 | 01110000 | 160 | 70 |
| 113 | 01110001 | 161 | 71 |
| 114 | 01110010 | 162 | 72 |
| 115 | 01110011 | 163 | 73 |
| 116 | 01110100 | 164 | 74 |
| 117 | 01110101 | 165 | 75 |
| 118 | 01110110 | 166 | 76 |
| 119 | 01110111 | 167 | 77 |
| 120 | 01111000 | 170 | 78 |
| 121 | 01111001 | 171 | 79 |
| 122 | 01111010 | 172 | 7A |
| 123 | 01111011 | 173 | 7B |
| 124 | 01111100 | 174 | 7C |
| 125 | 01111101 | 175 | 7D |
| 126 | 01111110 | 176 | 7E |
| 127 | 01111111 | 177 | 7F |
| 128 | 10000000 | 200 | 80 |
| 129 | 10000001 | 201 | 81 |
| 130 | 10000010 | 202 | 82 |
| 131 | 10000011 | 203 | 83 |
| 132 | 10000100 | 204 | 84 |
| 133 | 10000101 | 205 | 85 |
| 134 | 10000110 | 206 | 86 |
| 135 | 10000111 | 207 | 87 |
| 136 | 10001000 | 210 | 88 |
| 137 | 10001001 | 211 | 89 |
| 138 | 10001010 | 212 | 8A |
| 139 | 10001011 | 213 | 8B |
| 140 | 10001100 | 214 | 8C |
| 141 | 10001101 | 215 | 8D |
| 142 | 10001110 | 216 | 8E |
| 143 | 10001111 | 217 | 8F |
| 144 | 10010000 | 220 | 90 |
| 145 | 10010001 | 221 | 91 |
| 146 | 10010010 | 222 | 92 |
| 147 | 10010011 | 223 | 93 |
| 148 | 10010100 | 224 | 94 |
| 149 | 10010101 | 225 | 95 |
| 150 | 10010110 | 226 | 96 |
| 151 | 10010111 | 227 | 97 |
| 152 | 10011000 | 230 | 98 |
| 153 | 10011001 | 231 | 99 |
| 154 | 10011010 | 232 | 9A |
| 155 | 10011011 | 233 | 9B |
| 156 | 10011100 | 234 | 9C |
| 157 | 10011101 | 235 | 9D |
| 158 | 10011110 | 236 | 9E |
| 159 | 10011111 | 237 | 9F |
| 160 | 10100000 | 240 | A0 |
| 161 | 10100001 | 241 | A1 |
| 162 | 10100010 | 242 | A2 |
| 163 | 10100011 | 243 | A3 |
| 164 | 10100100 | 244 | A4 |
| 165 | 10100101 | 245 | A5 |
| 166 | 10100110 | 246 | A6 |
| 167 | 10100111 | 247 | A7 |
| 168 | 10101000 | 250 | A8 |
| 169 | 10101001 | 251 | A9 |
| 170 | 10101010 | 252 | AA |
| 171 | 10101011 | 253 | AB |
| 172 | 10101100 | 254 | AC |
| 173 | 10101101 | 255 | AD |
| 174 | 10101110 | 256 | AE |
| 175 | 10101111 | 257 | AF |
| 176 | 10110000 | 260 | B0 |
| 177 | 10110001 | 261 | B1 |
| 178 | 10110010 | 262 | B2 |
| 179 | 10110011 | 263 | B3 |
| 180 | 10110100 | 264 | B4 |
| 181 | 10110101 | 265 | B5 |
| 182 | 10110110 | 266 | B6 |
| 183 | 10110111 | 267 | B7 |
| 184 | 10111000 | 270 | B8 |
| 185 | 10111001 | 271 | B9 |
| 186 | 10111010 | 272 | BA |
| 187 | 10111011 | 273 | BB |
| 188 | 10111100 | 274 | BC |
| 189 | 10111101 | 275 | BD |
| 190 | 10111110 | 276 | BE |
| 191 | 10111111 | 277 | BF |
| 192 | 11000000 | 300 | C0 |
| 193 | 11000001 | 301 | C1 |
| 194 | 11000010 | 302 | C2 |
| 195 | 11000011 | 303 | C3 |
| 196 | 11000100 | 304 | C4 |
| 197 | 11000101 | 305 | C5 |
| 198 | 11000110 | 306 | C6 |
| 199 | 11000111 | 307 | C7 |
| 200 | 11001000 | 310 | C8 |
| 201 | 11001001 | 311 | C9 |
| 202 | 11001010 | 312 | CA |
| 203 | 11001011 | 313 | CB |
| 204 | 11001100 | 314 | CC |
| 205 | 11001101 | 315 | CD |
| 206 | 11001110 | 316 | CE |
| 207 | 11001111 | 317 | CF |
| 208 | 11010000 | 320 | D0 |
| 209 | 11010001 | 321 | D1 |
| 210 | 11010010 | 322 | D2 |
| 211 | 11010011 | 323 | D3 |
| 212 | 11010100 | 324 | D4 |
| 213 | 11010101 | 325 | D5 |
| 214 | 11010110 | 326 | D6 |
| 215 | 11010111 | 327 | D7 |
| 216 | 11011000 | 330 | D8 |
| 217 | 11011001 | 331 | D9 |
| 218 | 11011010 | 332 | DA |
| 219 | 11011011 | 333 | DB |
| 220 | 11011100 | 334 | DC |
| 221 | 11011101 | 335 | DD |
| 222 | 11011110 | 336 | DE |
| 223 | 11011111 | 337 | DF |
| 224 | 11100000 | 340 | E0 |
| 225 | 11100001 | 341 | E1 |
| 226 | 11100010 | 342 | E2 |
| 227 | 11100011 | 343 | E3 |
| 228 | 11100100 | 344 | E4 |
| 229 | 11100101 | 345 | E5 |
| 230 | 11100110 | 346 | E6 |
| 231 | 11100111 | 347 | E7 |
| 232 | 11101000 | 350 | E8 |
| 233 | 11101001 | 351 | E9 |
| 234 | 11101010 | 352 | EA |
| 235 | 11101011 | 353 | EB |
| 236 | 11101100 | 354 | EC |
| 237 | 11101101 | 355 | ED |
| 238 | 11101110 | 356 | EE |
| 239 | 11101111 | 357 | EF |
| 240 | 11110000 | 360 | F0 |
| 241 | 11110001 | 361 | F1 |
| 242 | 11110010 | 362 | F2 |
| 243 | 11110011 | 363 | F3 |
| 244 | 11110100 | 364 | F4 |
| 245 | 11110101 | 365 | F5 |
| 246 | 11110110 | 366 | F6 |
| 247 | 11110111 | 367 | F7 |
| 248 | 11111000 | 370 | F8 |
| 249 | 11111001 | 371 | F9 |
| 250 | 11111010 | 372 | FA |
| 251 | 11111011 | 373 | FB |
| 252 | 11111100 | 374 | FC |
| 253 | 11111101 | 375 | FD |
| 254 | 11111110 | 376 | FE |
| 255 | 11111111 | 377 | FF |
Which number system converter do you need?
Which method you need follows from the two bases, not from the tool you happen to open.
If your value is decimal and you want any other base, you are doing repeated division. If your value is binary, octal or hex and you want decimal, you are doing positional expansion. If both bases are powers of two, you are grouping bits — and octal to hex, or hex to octal, groups them twice, because the bits have to be re-cut on the way through.
Decimal is the odd base out in all three rules, which is why it is the pivot in one direction and never a grouping partner in the other. A converter here is one of those three methods with its working shown and its edge cases handled, so the page names the pair and the method underneath is one you have already read here. Nothing after this section adds a mechanism: the three rules above are the whole map. To pick a converter rather than a method, start from every binary converter.
Frequently Asked Questions
What is decimal, and why is it the pivot for every conversion?
Decimal is base 10, the notation you already compute in, so both universal methods route through it: repeated division starts there, and positional expansion ends there. It is also the base with no bit grouping, which is why the power-of-two shortcut reads as a trick.
Where do you meet octal and hexadecimal in practice?
Octal turns up in Unix file permissions, as in chmod 755, and in escape sequences. Hex turns up in memory addresses, colour codes, MAC addresses, hex dumps and error codes. Both are compact shorthand for bit patterns, which is why they cluster around low-level work.
Every conversion on this page is one of the two universal methods, or the bit-grouping shortcut that follows when both bases are powers of two. The values change with the input; the method behind them does not.