WebToolsPlanet
Converter Tools

Decimal to Hex Converter

Type any decimal number and instantly see its hexadecimal, binary, and octal equivalents.

Last updated: May 30, 2026

Client-Side Processing
Input Data Stays on Device
Instant Local Execution

Find this tool useful? Support the project to keep it free!

Buy me a coffee

What 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

1

Type or paste a decimal number into the input field

2

The hexadecimal, binary, and octal equivalents appear instantly

3

Click any "Copy" button to copy a specific result

4

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.

Decimal input
255
Hex equivalent
FF (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.