🔢 Decimal to Hex Converter

🔄
🔢
🎨
📏
📝
Hex digits: {{ hexDigitCount }} Value range: {{ getValueRange() }}
💡
📤
{{ output ||'Result will appear here...' }}
🔍
Step {{ index + 1 }}:
{{ step.description }}
{{ step.calculation }}
... and {{ conversionSteps.length - 10 }} more steps
📖
Hex Digits:
0=0, 1=1, 2=2, 3=3
4=4, 5=5, 6=6, 7=7
8=8, 9=9, A=10, B=11
C=12, D=13, E=14, F=15
Powers of 16:
16⁰ = 1
16¹ = 16
16² = 256
16³ = 4096
16⁴ = 65536
16⁵ = 1048576
Two's Complement ({{ bitWidth }}-bit):
Max positive: {{ getMaxPositive() }}
Max negative: {{ getMaxNegative() }}
⚠️ {{ error }}

ℹ️ About Decimal to Hex Converter

Hexadecimal is base 16 notation: each digit represents four binary bits, using 0-9 for values 0-9 and A-F for values 10-15. This decimal to hex converter works both ways, so you can translate base 10 integers into hexadecimal strings or turn hex values back into readable decimal numbers.

Use it when you need to inspect or document values that software commonly writes in hex:

  • Converting API, log, packet, or debugger values between decimal and hexadecimal.
  • Checking memory addresses, offsets, register values, and bit masks.
  • Formatting bytes for hex dumps, binary file analysis, firmware notes, or CTF writeups.
  • Verifying web color components such as #FF0000, where each color channel is stored as a hex byte.
  • Reading hash digests and checksums, which are often displayed as hexadecimal text.

For decimal to hex conversion, enter a whole number such as 255, 4096, or -1 in signed mode. The tool can output uppercase or lowercase hex, add an optional 0x prefix, and pad the result to a fixed width. In signed mode it uses two's complement interpretation for 8-, 16-, 32-, or 64-bit widths, so -1 becomes FF at 8 bits and FFFF at 16 bits.

For hex to decimal conversion, enter digits 0-9 and A-F; an initial 0x prefix is accepted. Examples: FF equals 255, 1000 equals 4096, and 0xDEADBEEF equals 3735928559. The step-by-step breakdown shows the powers of 16 used for each digit, which is useful when learning or auditing the conversion by hand.

Limitations: this tool is for integer conversion, not fractional decimal values or IEEE 754 floating-point encodings. Very large numbers may exceed JavaScript's safe integer range, so verify exact 64-bit boundary values with an arbitrary-precision workflow when precision is critical.

Source references: RFC 4648 Base16 defines the standard hex alphabet for byte-oriented encodings, ECMAScript hexadecimal integer literals document the 0x form used by JavaScript, ECMAScript Number.MAX_SAFE_INTEGER explains the safe integer boundary, and CSS Color 4 hex notation covers common web color hex syntax.

API Usage Example:

POST /api/tools/conversion/decimal-hex
Content-Type: application/json

{
    "mode": "decimal-to-hex",
    "input": "255",
    "numberType": "unsigned",
    "bitWidth": 8,
    "hexOptions": {
        "prefix": false,
        "uppercase": true,
        "padding": false,
        "padWidth": 4
    }
}
Ready