Free hexadecimal calculator
Convert decimal numbers to hexadecimal (base 16) — enter any positive integer to see its hex representation using digits 0–9 and A–F, updated live, as you type.
On this page10 sections
Hexadecimal (base-16) uses digits 0‑9 and letters A‑F. Only integers supported.
Results are estimates. Consult a professional.
How the hexadecimal calculator works
Hexadecimal (base-16) uses sixteen symbols: 0–9 and A–F, where A = 10 through F = 15. To convert a decimal number to hex, repeatedly divide by 16 and record the remainders — reading them in reverse produces the hex result. To convert hex back to decimal, multiply each digit by the corresponding power of 16 and sum the products.
Worked example: 255 to hex and 3A hex to decimal
Convert 255 to hexadecimal, then independently convert 3A₁₆ to decimal to illustrate both directions.
Key decimal values and their hex equivalents
These landmark values appear constantly in computing — memory boundaries, color channels, network masks, and byte limits. Knowing them by sight saves repeated conversion.
| Decimal | Hex | Context |
|---|---|---|
| 0 | 00 | Null / zero / black RGB channel |
| 1 | 01 | Minimum non-zero byte |
| 10 | 0A | Line feed (ASCII) |
| 15 | 0F | Maximum single hex digit |
| 16 | 10 | First two-digit hex number |
| 100 | 64 | Percentage base (e.g., 100% opacity = 0x64) |
| 128 | 80 | Midpoint of a byte; set sign bit in signed representation |
| 255 | FF | Maximum byte value; full-intensity RGB color channel |
Source: common computing reference values. In CSS color notation, #RRGGBB uses two hex digits (00–FF) per channel.
Tips for working with hexadecimal
Hex appears in HTML colors, memory dumps, network packets, and cryptographic hashes. These tips help you work with it confidently.
- Hex ↔ binary shortcut — Each hex digit maps directly to exactly 4 binary bits (a nibble), so you can convert between hex and binary one digit at a time without going through decimal.
- CSS colors — An RGB color like #1A2B3C means red = 0x1A = 26, green = 0x2B = 43, blue = 0x3C = 60. Each pair of hex digits is one color channel (0–255).
- 0x prefix convention — In most programming languages, hex literals are written with a leading 0x (e.g., 0xFF). In HTML/CSS, a # prefix is used instead.
- Mental division trick — Dividing by 16 is the same as dividing by 2 four times. If you're comfortable with binary, convert to binary first, then group nibbles.
- Spotting powers of 2 — Hex values like 0x10 (16), 0x100 (256), 0x1000 (4096) are always powers of 2, making them natural boundary markers in memory layouts.
Accuracy and limitations
The repeated-division algorithm is exact for any non-negative integer. Hexadecimal fractions (e.g., 0.1₁₆) exist mathematically but are uncommon in practice; this calculator handles whole numbers only. For very large integers (beyond JavaScript's safe integer range of 2⁵³ − 1), use a library that supports arbitrary-precision arithmetic.
Key terms
About this calculator
Part of our math calculators suite — explore all calculators.