Convert any decimal (base 10) number into hexadecimal (base 16) instantly. Enter a whole number below and see the result, plus the step by step division-remainder working and the binary and octal equivalents.
Hexadecimal (base 16) uses the digits 0 to 9 and the letters A to F. Each hex digit represents exactly 4 binary bits, which is why hexadecimal is the standard shorthand for binary data in computing, colour codes and memory addresses.
Only non-negative whole numbers are supported. Negative numbers are shown using a leading minus sign on the hex result.
To convert a decimal number to hexadecimal, repeatedly divide the number by 16 and record the remainder at each step. Convert each remainder into its hex digit (values 10 to 15 become A to F). Once the quotient reaches 0, read the remainders in reverse order, from the last one calculated to the first, to get the final hexadecimal number.
| Step | Division | Quotient | Remainder | Hex digit |
|---|---|---|---|---|
| 1 | 255 ÷ 16 | 15 | 15 | F |
| 2 | 15 ÷ 16 | 0 | 15 | F |
Reading the remainders from the last step to the first gives FF. So 255 in decimal equals FF in hexadecimal. As a quick check, FF = (15 × 16) + 15 = 240 + 15 = 255, which confirms the conversion.
| Decimal value | Hex digit |
|---|---|
| 0 to 9 | 0 to 9 |
| 10 | A |
| 11 | B |
| 12 | C |
| 13 | D |
| 14 | E |
| 15 | F |
Hexadecimal is popular in computing because each hex digit maps exactly onto 4 binary bits (a nibble), and 2 hex digits map onto a full byte (8 bits). This makes hexadecimal a far more compact and readable way to represent binary values than writing out long strings of 1s and 0s. You will see hexadecimal used in web colour codes (such as #1E40AF), memory addresses, MAC addresses, hash values, and error codes.
Sources: Standard base-16 (hexadecimal) numeral system conventions, as used in computer science and digital electronics.
This calculator handles non-negative whole numbers. Very large numbers are converted using standard JavaScript arithmetic and are accurate for typical use, but extremely large values may lose precision due to floating point limits.
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.