Decimal to Hex Converter Online

Convert any decimal integer to hexadecimal with step-by-step powers-of-16 expansion. Batch mode, all four bases shown side-by-side — 100% in your browser.

Enter a decimal number to see all four base representations.

What is decimal to hex conversion?

Decimal to hexadecimal conversion rewrites a base-10 number using the 16 hex digits 0-9 and A-F. Hex is the canonical shorthand for binary, used everywhere in low-level computing — memory addresses, RGB colors, MAC addresses, file hashes, and machine-code disassembly.

The OpenFormatter decimal-to-hex converter runs in your browser — instant, free, no rate limit, no upload. It shows the hex result, the equivalent binary and octal for context, and a digit-by-digit powers-of-16 expansion that explains exactly how each hex digit was chosen.

How to convert decimal to hex — 4 steps

  1. Enter a decimal integer. Any non-negative value up to 253−1.
  2. Read the hex output. The result is shown with a 0x prefix; binary and octal are shown alongside.
  3. Study the expansion. Each hex digit is multiplied by its place value (16n) — useful for learning positional notation.
  4. Switch to batch mode. Convert many values at once and copy the table to Excel or Google Sheets.

Sample input and output

Input:  255

Output:
  Decimal: 255
  Hex:     0xFF
  Binary:  11111111
  Octal:   0o377

Expansion: 255 = F × 16^1 (240) + F × 16^0 (15) = 0xFF

255 fits in exactly one byte and is the largest 8-bit unsigned value — that's why 0xFF appears in countless protocols, color codes, and bitmasks.

Single + Batch Modes

Convert one value with full educational expansion, or paste hundreds of decimals (one per line) for a copyable conversion table.

Educational Expansion

Powers-of-16 breakdown shows how each hex digit contributes — the same algorithm a CPU uses to interpret a value.

Client-Side Only

All math runs in the browser via Number.prototype.toString(16). Nothing is uploaded — verify in DevTools Network.

Common use cases

  • check_circleWeb design — converting RGB(255, 136, 0) to CSS color #FF8800
  • check_circleProgramming — writing hex literals 0xCAFEBABE, 0xDEADBEEF, magic numbers
  • check_circleNetworking — formatting MAC addresses, IPv6 segments, protocol fields
  • check_circleEmbedded systems — register dumps, firmware addresses, peripheral configuration
  • check_circleReverse engineering — reading disassembly offsets, function addresses, structure padding
  • check_circleFile hashing — formatting MD5, SHA-1, SHA-256 digests as hex strings
  • check_circleCryptography — converting integer keys, IVs, and counters to hex for transport
  • check_circleDebugging — interpreting error codes, exit codes, and HRESULT values

The conversion math, explained

The tool calls JavaScript's Number.prototype.toString(16). That method implements the standard division-by-16 algorithm: divide by 16, collect each remainder (mapped to 0-9 and A-F), and reverse. For 255 that's 255 ÷ 16 = 15 remainder 15 → F, then 15 ÷ 16 = 0 remainder 15 → F. Reading reverse gives FF. Equivalently, 255 = 15·16 + 15 = F·161 + F·160 = 0xFF — which is what the expansion panel above the FAQ shows.

Need the reverse direction?

Browse the rest of the OpenFormatter base toolkit — every conversion runs in your browser.

Frequently Asked Questions

What is hexadecimal?

Hexadecimal is a base-16 number system that uses 16 digits: 0-9 and A-F. Each hex digit represents exactly 4 binary bits (one nibble), making hex an extremely compact and human-readable shorthand for binary. Computer memory addresses, RGB colors, MAC addresses, and most low-level identifiers are written in hex for that reason.

Why use hex instead of decimal?

Hex aligns naturally with binary because 16 = 2^4. Eight bits collapse to two hex digits, sixteen bits to four — far easier to read than long binary strings or large decimals. Hex also exposes structure: a 32-bit IPv4 address printed as 0xC0A80101 visibly contains the four octets 192, 168, 1, 1.

How does each hex digit map to binary?

Every hex digit is exactly 4 binary bits: 0=0000, 1=0001, 2=0010, 3=0011, 4=0100, 5=0101, 6=0110, 7=0111, 8=1000, 9=1001, A=1010, B=1011, C=1100, D=1101, E=1110, F=1111. To convert a binary string to hex, group bits into 4-bit nibbles from the right.

How does decimal to hex conversion work?

Repeatedly divide the decimal by 16, recording each remainder (0-15, with 10-15 written as A-F). Read the remainders in reverse to get the hex string. For 255: 255 ÷ 16 = 15 remainder 15 → write F, then 15 ÷ 16 = 0 remainder 15 → write F. Reading reverse gives FF. JavaScript uses (n).toString(16).

Is hex output case-sensitive?

Hex letters A-F can be written in either case — both 0xFF and 0xff parse to 255. This tool emits uppercase by convention because uppercase is the dominant style in C, Java, hardware specs, and most documentation. Lowercase is more common in CSS color codes and Unix tools.

What is the largest decimal I can convert?

Up to Number.MAX_SAFE_INTEGER (2^53 − 1 = 9,007,199,254,740,991). Above that, JavaScript number precision degrades. For 64-bit unsigned integers and bigger, use BigInt or a big-integer library — typical cryptographic and blockchain use cases.

Are CSS colors related to hex?

Yes. CSS colors like #FF8800 are three pairs of hex digits, each pair encoding one byte (0-255) for red, green, and blue. So #FF8800 = R 255, G 136, B 0. This converter helps you go between the two representations.

Is the data sent to a server?

No. All conversion runs in JavaScript inside your browser. Open DevTools → Network and confirm zero requests on Convert. Safe to use with internal IDs, secret tokens, or proprietary numeric data.

Decimal to Hex Converter Online — Free Base-10 to Hexadecimal Tool