Decimal to Hex Converter
Type any decimal number and instantly see its hexadecimal, binary, and octal equivalents.
Last updated: May 30, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is Decimal to Hex Converter?
Decimal is the familiar base-10 number system (digits 0–9) that we use in everyday life. Hexadecimal (hex) is the base-16 system that uses digits 0–9 and letters A–F (A=10, B=11, C=12, D=13, E=14, F=15).
Hex is preferred in programming and computing for several reasons: - One hex digit represents exactly 4 binary bits (a "nibble"), making hex a compact shorthand for binary. - Two hex digits represent exactly 8 bits (one byte), so 255 decimal = FF hex = 1 byte at maximum value. - Memory addresses, colour codes, and cryptographic hashes are traditionally displayed in hex.
Common uses for decimal-to-hex conversion: - CSS colours: each RGB channel ranges from 0–255 (decimal) → 00–FF (hex). So rgb(255, 144, 30) = #FF901E. - Memory addresses: 0xDEADBEEF = 3,735,928,559 decimal. - Network packet values displayed in Wireshark or hex editors.
How to Use Decimal to Hex Converter
Type or paste a decimal number into the input field
The hexadecimal, binary, and octal equivalents appear instantly
Click any "Copy" button to copy a specific result
Click "Load Sample" to see the classic 255 → FF example
Common Use Cases
- Converting RGB colour component values (0–255) to two-digit hex codes for CSS (#RRGGBB).
- Reading memory dumps: converting a decimal address to the hex address shown in a debugger.
- Understanding network protocol byte values by converting decimal to hex.
- Encoding ASCII character codes as hex escape sequences (\xFF).
- Converting decimal port numbers or error codes to hex for protocol documentation.
- Checking that a decimal hash value matches an expected hex value in security tools.
Example Input and Output
The decimal number 255 (maximum byte value) converts to FF in hex, 11111111 in binary, and 377 in octal.
255FF (hex) = 11111111 (binary) = 377 (octal)Privacy
All conversions run in your browser using JavaScript BigInt. No data is sent to any server.
Hex and CSS colours
To build a CSS hex colour from RGB values: convert each of the three decimal values (0–255) to two hex digits. Use this tool for each channel, then concatenate: R=255→FF, G=144→90, B=30→1E → #FF901E.
Frequently Asked Questions
How do I convert decimal to hex manually?
Repeatedly divide the decimal number by 16, recording the remainder as a hex digit each time. Remainders 10–15 are written as A–F. Read the remainders from bottom to top. Example: 255 ÷ 16 = 15 R 15 (F), 15 ÷ 16 = 0 R 15 (F) → FF.
How do CSS hex colour codes work?
A CSS hex colour like #FF901E has three two-digit hex pairs: FF (red = 255), 90 (green = 144), 1E (blue = 30). Each pair is a decimal value from 0–255. Convert: 0x1E hex = (1×16) + 14 = 30 decimal. Use this tool to convert each channel value to hex.
What does 0x mean before a hex number?
0x is the standard prefix for hexadecimal numbers in C, JavaScript, Python, and most programming languages. 0xFF means "the hex value FF" = 255 decimal. This tool does not add the 0x prefix — just the digits — so you can add it yourself when needed.
Can I convert negative decimal numbers?
Yes. The tool accepts negative integers and prefixes the hex result with a minus sign. Note that this is magnitude representation, not two's complement — if you need two's complement hex for a specific bit width, use the Number Base Converter.
How large a decimal number can this convert?
This tool uses JavaScript BigInt, which handles arbitrarily large integers with no precision loss — far beyond the 2⁵³ limit of regular JavaScript numbers.
Related Tools
Number Base Converter
Convert numbers between binary, decimal, hexadecimal, octal, and any custom base — with bit grouping, signed integers, and step-by-step explanation.
Binary to Decimal Converter
Convert binary numbers (base 2) to decimal (base 10). Also shows hexadecimal and octal equivalents. Supports large binary numbers.
Binary to Hex Converter
Convert binary numbers (base 2) to hexadecimal (base 16). Also shows decimal and octal equivalents. Supports large binary numbers with BigInt precision.
Binary to Octal Converter
Convert binary numbers (base 2) to octal (base 8). Also shows decimal and hexadecimal equivalents. Supports large binary numbers with BigInt precision.
HEX to RGB
Convert a HEX colour code to RGB values instantly. Shows the CSS rgb() function output with a live colour preview.
Decimal to ASCII Converter
Convert decimal ASCII codes to their corresponding characters. Enter space or comma-separated decimal values and get the ASCII text instantly.

