Computers count in binary, and people write those numbers in hex because each hex digit stands for four binary digits. You meet hex in colour codes like #1E90FF and in MAC addresses, and binary in IP addresses and subnet masks. This hex to decimal converter turns any of them into an ordinary number, and an ordinary number back into binary and hex.
There are three boxes, and each one is converted on its own: a hex number to decimal and binary, a binary number to decimal and hex, and a decimal number to binary, hex and octal. Capitals, spaces and a 0x, 0b or # in front are all fine. Every figure it supplies names its source, and the list of what it cannot tell you is below the answer.
In this guide
The hex to decimal converter
Digits 0 to 9 and A to F, in capitals or not. A 0x or a # in front is fine. For a colour code, put in one pair at a time.
Only 0s and 1s. Spaces between groups, as in 1100 0000, are fine, and so is a 0b in front.
An ordinary whole number from 0 up, typed without commas.
How that is worked out, line by line
- The hex number in binary1111 1111
- The binary number in hexB
- The decimal number in octal144
On those numbers you are in the One byte, 00 to FF band, which is the section below.
This runs entirely inside your browser. Nothing you type is sent anywhere, saved or read by this site, and the page keeps working with the network unplugged.
Newsletter
One email a week, and only when there is something in it
Every guide I published or rewrote that week, up to six of them, each with a line on who it is for and what it settles. No prices, no deals, nothing else.
It goes out on Thursday mornings. In a week when nothing new went up, nothing is sent.
Your address goes to MailerLite, who deliver the email, and nowhere else. Every email has an unsubscribe link. The email ends with one link to my Amazon storefront, and as an Amazon Associate I earn from qualifying purchases. Privacy policy.
Where every number here comes from
No part of this was measured on a bench here. This site works from published specifications and from what owners report, and every number below is either one you typed in or a published figure with its source named next to it.
The figures this page supplies
- Digits in hexadecimal: 16. RFC 4648, section 8 (Base 16 Encoding): an alphabet of 16 characters, 0 to 9 and then A to F for 10 to 15, each one carrying 4 bits.
- Digits in binary: 2. ECMA-262, the JavaScript standard, Number.prototype.toString: a number written in any base from 2 to 36, base 2 with the two digits 0 and 1. This page's script prints its binary, hex and octal with it.
- Largest number one byte holds: 255. RFC 791: an IPv4 address is four octets of 8 bits, so each part runs from 0 to 255, which is FF in hex and 1111 1111 in binary.
Why each step is the step it is
- Hex in decimal:
hex_in. Each hex digit times its place value, added up: every place is worth 16 times the place to its right, and A to F are 10 to 15 (RFC 4648, section 8). - Binary in decimal:
bin_in. Each binary digit times its place value, added up: every place is worth twice the place to its right, so only the places holding a 1 count. - Decimal in binary:
dec + dec_ok. The decimal number written in base 2, in groups of four digits from the right so it reads easily. - Decimal in hex:
dec + dec_ok. The decimal number written in base 16, with A to F for the digits 10 to 15. - The hex number in binary:
hex_in. Each hex digit is four binary digits, because 16 is 2 to the power of four. - The binary number in hex:
bin_in. Every four binary digits, counted from the right, make one hex digit. - The decimal number in octal:
dec + dec_ok. The decimal number written in base 8, with the digits 0 to 7.
What this cannot tell you
Every calculator has an edge, and a page that hides its edge is worse than no page at all. Here is this one's.
- It converts whole numbers from 0 up to 4,503,599,627,370,495 (2^52 - 1, thirteen hex digits). That keeps every answer clear of the point where a browser's JavaScript starts rounding whole numbers. A bigger number is moved to that figure, and the page says so.
- It has no negative numbers and no fractions. Signed binary (two's complement) and binary fractions follow rules this page does not apply.
- It converts numbers, not text. Turning words into binary or hex goes through a character code such as ASCII or UTF-8, which it does not do.
- It reads a number and nothing more. It does not check whether a MAC address, an IP address or a colour code is real, in use, or right for where you are putting it.
- A whole colour code or MAC address typed in at once is read as one big number. For a colour, put the pairs in one at a time to get red, green and blue.
Where a hex number that size turns up
These follow from the answer above and nothing else. Each heading below covers one span of results, so read the one the calculator pointed you at and ignore the rest.
One byte, 00 to FF
Eight bits, the size of one part of an IPv4 address and of each red, green and blue pair in a colour code. A screen sold as 8-bit shows each colour in this many steps above zero, and the monitor guide below explains what that and 10-bit mean when you are buying one.
Monitor Buying Guide 2026: The Specs Worth Paying For covers this range in full.
Up to three bytes
Up to FFFFFF, 24 bits, which is a whole colour code: two hex digits each for red, green and blue. For a colour, the pairs read one at a time are what a colour picker means, so put each pair in the hex box on its own.
Monitor Buying Guide 2026: The Specs Worth Paying For covers this range in full.
Up to four bytes, an IPv4 address
Up to FFFFFFFF, 32 bits, the length of a whole IPv4 address. The subnet calculator shows an address in its usual dotted form and works out the network it is in, and the guides below cover the routers and mesh systems that hand those addresses out at home.
Best WiFi Router for Home in 2026: 5 Ranked Picks covers this range in full.
Mesh Wi-Fi Setup 2026: 4 Best Kits and Node Placement Tips covers this range in full.
Up to six bytes, a MAC address
Up to FFFFFFFFFFFF, 48 bits, the length of a network MAC address, which every Wi-Fi adapter and network port carries. The guide below covers wired and wireless connections and what each is good for.
Wireless vs Wired Network 2026: The Best Setup Is Both covers this range in full.
More than six bytes
Past 48 bits, up to the 52 bits this converter covers. Numbers this long are usually IDs, file sizes in bytes or memory addresses rather than anything on a box, and this site has nothing to recommend for them.
The binary answers are printed in groups of four so they are easier to read; each group is one hex digit, and the boxes take the digits back with or without the spaces. For an IP address, the subnet calculator takes the four parts and the prefix and works out the whole network, and the GB to TB converter covers the other place where binary counting turns up, drive sizes.
Subnet masks are where binary to decimal pays off most often. Each part of a mask is one byte, so put 255 in the decimal box and it comes back as 1111 1111, eight ones; 0 comes back as 0. A mask of 255.255.255.0 is therefore 24 ones followed by 8 zeros, which is why it is written /24. A part such as 192 is 1100 0000, two ones, so 255.255.255.192 is a /26. Reading a mask one part at a time like this is the quickest way to check a prefix by hand, and the subnet calculator does the rest of the sum for the whole address.
Questions about the hex to decimal converter
How do I convert hex to decimal?
Multiply each digit by its place value and add them up. Every place is worth 16 times the place to its right, and the letters A to F stand for 10 to 15. So FF is fifteen sixteens and fifteen ones, which is 255, the largest number one byte holds. 1A is one sixteen and ten ones, 26, and 7E8 is 2,024. Type any hex number into the first box above and this hex to decimal converter does the sum, with or without a 0x in front.
How do I convert binary to decimal?
Add up the places that hold a 1. Reading from the right, the places are worth 1, 2, 4, 8 and so on, each one 2 times the last. 1011 has a 1 in the eights, twos and ones places, so it is 11. 1111 1111 has a 1 in all eight places and is 255, the most one part of an IP address can be, and 1100 0000 is 192. The binary box above takes the digits with or without spaces between the groups.
How do I convert decimal to binary?
Divide by 2 again and again, writing down each remainder, then read the remainders from the last one back to the first. 100 gives 110 0100. 192, the first part of most home network addresses, gives 1100 0000, and 1000 gives 11 1110 1000. This converter prints binary in groups of four from the right, which only makes it easier to read: the same digits without the spaces are the same number.
How do I convert decimal to hex?
Divide by 16 again and again, write each remainder as a hex digit, with 10 to 15 written as A to F, and read them from the last back to the first. 100 is 64, 4096 is 1000, and 255 is FF, the most one byte holds. The working above also gives the number in octal, base 8: 100 is 144.
How do I read a hex colour code?
Split it into three pairs after the #: red, green and blue, each a hex number from 00 to FF, which is 0 to 255. In #1E90FF, 1E is red 30, 90 is green 144 and FF is blue 255. Put one pair at a time into the hex box to read any colour. The whole code typed at once is read as one number, 2,003,199, which is not what a colour picker means by it.
Why is each hex digit four binary digits?
Because 16 is 2 to the power of four, so one hex digit holds exactly what four bits hold. That is why this converter groups binary in fours: FF in hex is 1111 1111 in binary, one group for each digit, and 1011 is B. A network MAC address is 48 bits, the IEEE's EUI-48, so it is 12 hex digits long, and the largest one, FFFFFFFFFFFF, is 281,474,976,710,655.
Sources
- RFC 4648: The Base16, Base32, and Base64 Data Encodings: Section 8, Base 16 Encoding, sets the hex alphabet: 16 characters, 0 to 9 and A to F for the values 0 to 15, 4 bits each, read the same in capitals or not.
- ECMA-262: the ECMAScript (JavaScript) language specification: Defines Number.MAX_SAFE_INTEGER, 2^53 - 1, past which whole numbers are rounded; this page stops one bit short of it. Also Number.prototype.toString, which writes a number in a base from 2 to 36.
- RFC 791: Internet Protocol: Makes an IPv4 address four octets of 8 bits each, which is why each part of an address is 0 to 255 and 8 binary digits long.
- W3C: CSS Color Module Level 4: Section 5.2, The RGB Hexadecimal Notations: #RRGGBB, where each pair of hex digits is the red, green or blue part of a colour.
- IEEE Registration Authority: frequently asked questions: Describes the 48-bit Extended Unique Identifier (EUI-48), the form used for network MAC addresses, which is 12 hex digits.
Subnet Calculator 2026: Easy IPv4 Ranges, Masks and Hosts GB to TB Converter 2026: Why 1 TB Actually Shows 931 GB
All of my current picks in one place: the Everyday Tech Reviews Amazon storefront.
New to Prime? Start a Prime free trial for fast, free delivery on most of these picks (eligible new members).
Related guides
- Bits to Bytes Converter 2026: Easy Mbps to MB/s Math
- VA to Watts Converter 2026: Easy kVA Calculator, Too
- Watts to Amps Converter 2026: Easy Amps to Watts, Too
- Download Time Calculator 2026: How Long It Actually Takes
