Convert any binary number (base 2) to its hexadecimal equivalent (base 16) instantly. Enter your binary digits below and see the hex result along with a step-by-step nibble-by-nibble breakdown.
| Group # | 4-Bit Nibble | Binary Value | Hex Digit |
|---|
Binary (base 2) uses only the digits 0 and 1. Hexadecimal (base 16) uses the digits 0 through 9 and the letters A through F, where A=10, B=11, C=12, D=13, E=14, and F=15. The key relationship is that 16 = 2 to the power of 4, which means one hexadecimal digit maps exactly to four binary digits (called a nibble).
To convert binary to hex, group the binary digits into sets of 4 starting from the rightmost digit. If the leftmost group has fewer than 4 digits, pad it with leading zeros. Then look up or calculate the hex value for each 4-bit group.
| Binary | Decimal | Hex | Binary | Decimal | Hex |
|---|---|---|---|---|---|
| 0000 | 0 | 0 | 1000 | 8 | 8 |
| 0001 | 1 | 1 | 1001 | 9 | 9 |
| 0010 | 2 | 2 | 1010 | 10 | A |
| 0011 | 3 | 3 | 1011 | 11 | B |
| 0100 | 4 | 4 | 1100 | 12 | C |
| 0101 | 5 | 5 | 1101 | 13 | D |
| 0110 | 6 | 6 | 1110 | 14 | E |
| 0111 | 7 | 7 | 1111 | 15 | F |
Convert binary 10101111 to hexadecimal:
So 10101111 in binary = AF in hexadecimal = 175 in decimal. You can verify: A (10) x 16 + F (15) = 160 + 15 = 175.
Programmers and engineers use hexadecimal because it dramatically compresses binary representations. A full 8-bit byte such as 11001010 becomes just CA in hex. A 32-bit IPv4 address, a 24-bit RGB colour value, or a 64-bit memory address are all much more readable and writable in hex than in raw binary. Hexadecimal is also directly supported in most programming languages using the 0x prefix (for example, 0xAF in C, Python, or JavaScript evaluates to 175).
Method: Group binary digits into 4-bit nibbles from the right, padding with leading zeros as needed, then map each nibble to its hexadecimal digit using the standard nibble lookup table (0000=0 through 1111=F). This is equivalent to converting binary to decimal first, then to hexadecimal, but the nibble method is faster for manual conversion and is the basis for how computers internally represent data.
This converter handles unsigned binary integers of any length. It does not interpret two's complement negative numbers. For very large binary strings, the decimal equivalent shown uses JavaScript's standard number type, which is accurate to 53 bits. Strings longer than 53 bits will show an approximate decimal value, but the hexadecimal result remains exact because it uses nibble-by-nibble string conversion.
If you've found a bug, or would like to contact us, or learn more about James Graham and Calculate.co.nz.
Calculate.co.nz is partnered with Interest.co.nz for New Zealand's highest quality calculators and financial analysis.
Calculate.co.nz is the sister site of CalculatorHub.com, the world's largest calculator website by tool count.
All calculators and tools are provided for educational and indicative purposes only and do not constitute financial advice.
Calculate.co.nz is proudly part of the Realtor.co.nz group, New Zealand's leading property transaction literacy platform, helping Kiwis understand the home buying and selling process from start to finish. Whether you're a first home buyer navigating your first property purchase, an investor evaluating your next acquisition, or a homeowner planning to sell, Realtor.co.nz provides clear, independent, and trustworthy guidance on every step of the New Zealand property transaction journey.
Calculate.co.nz is also partnered with Health Based Building and Premium Homes to promote informed choices that lead to better long-term outcomes for Kiwi households.
Calculate.co.nz is hosted in Auckland via SiteHost new Zealand.
All content on this website, including calculators, tools, source code, and design, is protected under the Copyright Act 1994 (New Zealand). No part of this site may be reproduced, copied, distributed, stored, or used in any form without prior written permission from the owner.
About & trust: Why Calculate is NZ's most comprehensive · By the Numbers · How we compare · Editorial standards · How we keep data current · NZ finance glossary · Research & data · Financial literacy NZ · About · Privacy policy · Terms of use
Reviewed and maintained. Last reviewed 2026-07-02 and checked on a twice-monthly cycle against IRD, RBNZ and Stats NZ. How we keep data current.
© 2026 Calculate.co.nz. All rights reserved. Building free NZ calculators since 2011.