Decimal to Hexadecimal Converter

Decimal and hex do not align the way binary and hex do — crossing between them takes real division. Enter a decimal number for its hex form, or hex for decimal, and this decimal to hexadecimal converter shows the answer with the method behind it.





The Method: Divide by Sixteen, Read the Remainders Up

Base conversion by repeated division works for any target base, and hex’s is division by 16: divide the number, record the remainder (0–15, written as 0–9 then A–F), divide the quotient again, and continue until the quotient is zero — then read the remainders in reverse, last first. The widget performs the divisions and prints every step in its note, because the steps are the education: each remainder is one hex digit, from least significant to most, and the method’s correctness is visible at a glance (re-multiply: the digits’ place values must rebuild the number). Small cases build the instinct: 255 ÷ 16 = 15 remainder 15 (F), then 15 ÷ 16 = 0 remainder 15 (F) — 255 = 0xFF; 16 itself is 0x10, the base wearing its own name, as ten is “10” in decimal. The reverse crossing (hex to decimal) uses place values directly — digits × powers of 16, summed — and the note under that direction works the famous BEEF in full: 11×4096 + 14×256 + 14×16 + 15 = 48,879.

Worked Example: 48879, or BEEF

The default is computing’s favourite decimal number: 48879 = 0xBEEF. The division chain runs 48879 → remainder 15 (F), 3054 → remainder 14 (E), 190 → remainder 14 (E), 11 → remainder 11 (B), and the remainders read upward spell the word — one of the hex alphabet’s gifts (with DEAD, CAFE, FACE, C0FFEE) that programmers plant as markers in memory, test data and file formats, precisely because they are unmissable in a dump. A sober second example anchors the calendar: the year 2026 = 0x7EA (7×256 = 1792, plus 14×16 = 224, plus 10 = 2026) — a number nobody will plant anywhere, which is the point: the famous words are the exceptions that teach the alphabet, and the method handles the anonymous numbers identically. The widget’s binary readout for the default (1011111011101111) closes the triangle — decimal for humans, hex for display, binary for the machine — with the sibling converter handling the binary-hex side where no division is needed at all.

Why Hex Earned Its Place: Compactness With Structure

Hex persists because it solves two problems at once. Against decimal, it preserves the machine’s structure: a byte is two digits, boundaries fall on powers of 16 that are also powers of 2, and bit patterns survive translation (the sibling page’s nibble reading). Against binary, it is four times shorter — a 64-bit address is 16 characters instead of 64 — short enough to print, dictate and compare by eye. The costs are the ones this page exists to pay down: hex arithmetic is unintuitive (0xA + 0xA = 0x14, not 0x20, and nobody’s schooling covered it), and decimal-hex conversion, unlike binary-hex, has no grouping shortcut — it is division or place-value summation every time. Professional practice routes around both: software converts, humans verify magnitudes (a hex number’s size is roughly its digit count × 4 bits), and memorable values (powers of two are 1 followed by zeros in hex too — 0x1000 is 4096) anchor the scale. The verification habit is worth copying at any level: convert, then convert back by the opposite method, and trust the answer only when the round trip closes exactly, to the digit — the discipline this page’s two directions exist to make easy. The RFC 4648 family of encodings (base16 is hex’s formal standardisation) documents the alphabet’s canonical form for data interchange.

Fractions and Limits: Where Hex Gets Awkward

Honesty about scope: this converter handles whole numbers, because decimal fractions in hex are the system’s awkward corner — 0.1 in decimal is an infinite repeating hex fraction (0x0.1999…), since tenths are not sixteenths, and floating-point work crosses between the bases through binary, not directly. Very large integers meet a second limit: beyond 2⁵³, JavaScript’s numbers (and therefore this widget) cannot represent every integer exactly, so conversions of enormous values should be done digit-by-digit in arbitrary-precision tools — the method is identical, only the arithmetic needs bigger buckets. Within the whole-number range of ordinary computing — addresses, counts, colours (a 24-bit colour is a six-digit hex, 0–16,777,215), file sizes, error codes — the conversion here is exact, and the steps shown let any reader audit it with pencil and patience. The limits named are not apologies; they are the boundary lines that tell you when to reach for a different instrument.

Error Codes and Addresses: Decimal’s Travelling Disguises

Two everyday encounters motivate most crossings. Error codes: Windows and many systems print fault codes in hex (0x80004005 and its family) because the code’s bits are flags — the leading 8 marks severity and facility in the high nibble, information destroyed by the decimal form the same code wears elsewhere (that one is 2147503653 as a signed decimal in documentation, a number with no visible structure at all). Searching the hex form finds the knowledgeable forum threads; searching the decimal finds the confused ones — the conversion is a research skill. Addresses and offsets: a file’s error at “offset 1,048,576” is at 0x100000, the megabyte boundary, a fact that changes the diagnosis (boundaries are where bugs live) and is invisible until converted. The pattern generalises the page’s thesis: decimal is for counting how many; hex is for seeing the structure; and fluent practitioners convert into whichever form makes the fact visible — the calculator serving both directions without preferring either.

Related Tools

More from the Conversion Calculators hub: the Binary to Hexadecimal Converter — the grouping crossing, no division — the Binary Calculator, and the Color Converter, where six-digit hex values turn back into colours.

Frequently Asked Questions

How do you convert decimal to hex by hand?

Divide by 16 repeatedly, writing each remainder as a hex digit (10 becomes A, 11 B, up to 15 F), and read the remainders from last to first. Check by place values: the digits, times powers of 16 from the right, must sum to the original. The widget prints its division steps precisely so the hand method can be followed against them — try 255 (two divisions, FF) and 2026 (three, 7EA) against the machine and the method is yours.

What is 255 in hex, and why does it matter?

0xFF — the largest two-digit hex number, and the largest value of an unsigned byte. It matters because bytes are computing’s atom: 255 caps a colour channel (hence #FF0000), an IPv4 octet, and a character code in the old ASCII-extended world. Its neighbours are equally loaded: 256 is 0x100 (one past the byte, a carry into the third digit) and 65535 is 0xFFFF, the 16-bit ceiling. Learning the byte’s landmarks — 16, 255, 256, 4096 (0x1000) — gives hex numbers a felt size before any conversion.

How do I convert hex to decimal?

Place values: from the right, the digits are worth 16⁰, 16¹, 16² and so on — multiply each digit (A = 10 … F = 15) by its power and sum, as the widget’s note demonstrates on 0xBEEF = 48,879. A fast estimation trick rides along: the leading digit times its power dominates, so 0x7EA is immediately “seven 256s and change” — about 1,800–2,050 — before the exact sum (2026) is finished. The converter’s reverse direction does the full sum instantly; the hand method keeps the number’s size honest in your head while you wait.

What is 1000 in hex?

0x3E8 — checkable by place values: 3×256 = 768, E is 14, 14×16 = 224, plus 8 = 1000 exactly. The number is a quiet landmark: a thousand, so round in decimal, is anonymous in hex, while 1024 (the binary thousand, 2¹⁰) is the tidy 0x400 — the two systems take turns making numbers look natural, and computing belongs to the powers of two. Its neighbours orient the thousands: 2000 is 0x7D0, 4095 is 0xFFF (the 12-bit ceiling), and 10000 is 0x2710. These four conversions, done once by hand against the widget’s printed steps, calibrate the whole thousands range — after them, a hex value’s size can be estimated from its leading digits alone, which is most of what fluency means in practice.

What does the 0x prefix mean, and must I type it?

It declares “hexadecimal follows” in C-derived notation (0b similarly declares binary), preventing a digits-only hex value like 1010 from being misread as decimal. This converter accepts input with or without it — the direction you select already declares the base — and prints results with it, because output travels into contexts (code, documentation) where the declaration is required for the number to mean what it says.

Can hex represent negative numbers?

In computing, usually by two’s complement rather than a sign: a 32-bit −1 is stored as 0xFFFFFFFF, the all-ones pattern, and whether a hex value is signed or unsigned is a decision of the reading system, not of the digits. This converter takes the signed route (an explicit minus sign is preserved and applied) because it serves human readers; when you meet hex in memory dumps or registers, assume two’s complement until the context says otherwise — the digits FFFFFFFF alone cannot tell you which world they live in.