Math calculator

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.

InputsLive
Conversion direction
Decimal integer
Enter a non-negative whole number to convert to hex.
Result
Hex
FF
Decimal 255 = 0xFF in hexadecimal.
Input255
OutputFF

Hexadecimal (base-16) uses digits 0‑9 and letters A‑F. Only integers supported.

Results are estimates. Consult a professional.

How it's calculated

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.

Decimal → Hex: divide by 16, collect remainders (use A–F for 10–15), reverse
Hex → Decimal: Σ (hex digit value × 16^position), positions count from 0 at the right
Hexadecimal is defined in ISO/IEC 80000-2 and is the standard notation for memory addresses, color codes, and byte-level data in computing.
Example

Worked example: 255 to hex and 3A hex to decimal

Example: 255₁₀ → hex, and 3A₁₆ → decimal

Convert 255 to hexadecimal, then independently convert 3A₁₆ to decimal to illustrate both directions.

255 ÷ 16 = 15 remainder 15 → digit: F
15 ÷ 16 = 0 remainder 15 → digit: F
Reading remainders bottom-to-top: FF₁₆
3A₁₆: A = 10, so…
3 × 16¹ + 10 × 16⁰ = 48 + 10 = 58
255 = FF₁₆
255 in decimal is FF in hexadecimal. 3A₁₆ equals 58 in decimal.
Quick reference

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.

DecimalHexContext
000Null / zero / black RGB channel
101Minimum non-zero byte
100ALine feed (ASCII)
150FMaximum single hex digit
1610First two-digit hex number
10064Percentage base (e.g., 100% opacity = 0x64)
12880Midpoint of a byte; set sign bit in signed representation
255FFMaximum 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.

Practical tips

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 & limits

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.

Glossary

Key terms

A numeral system using 16 symbols: digits 0–9 and letters A–F. Each digit represents a value from 0 to 15.
4 binary bits, equivalent to one hexadecimal digit. Values range from 0 (0000₂) to 15 (1111₂ = F₁₆).
8 bits, or 2 hex digits. A byte holds values from 00₁₆ (0) to FF₁₆ (255).
A conventional prefix indicating a hexadecimal literal in source code (e.g., 0xFF = 255). Originates from C programming language conventions.
A numeral system where each digit's value depends on its position. In hex, positions represent powers of 16 (1, 16, 256, 4096, …).
A 6-character hex string (#RRGGBB) used in HTML/CSS. Each 2-digit pair specifies one color channel (red, green, blue) from 00 to FF.
About

About this calculator

Part of our math calculators suite — explore all calculators.

Questions

Frequently asked questions about the free hexadecimal calculator

A hexadecimal calculator is a free online tool that helps you convert decimal to hexadecimal. Base 16 representation. It runs entirely in your browser with instant results and no sign-up.
JavaScript double-precision floating-point — accurate to about 15-17 significant digits. For arbitrary precision, use the Big Number calculator.
The statistics calculator computes population variance (divides by n). For sample variance, multiply variance by n/(n-1).

Want a calculator built for your business?

Customize any of our 400+ tools to match your brand, or commission a new one tailored to how your business actually calculates — pricing, payroll, quotes, anything. Deployed on your domain, math runs in your visitors' browsers.