Tools

Home
Decimal to BinaryDecimal to BCDDecimal to Gray CodeBinary to DecimalString to Hex

Decimal to Hex Converter

Convert decimal numbers to hexadecimal online. Supports single or batch conversion with prefix, case, and padding options.

Your files never leave your browser
INPUT (DECIMAL)0 numbers
OUTPUT (HEX)0 values
Ready·Uppercase | No prefix | No padding

Drop in a decimal number and get the hex back — FF for 255, or DEADBEEF for 3735928559. Batch mode handles a full column at once, and you can tack on a 0x prefix or zero-pad to 2, 4, or 8 digits when your code needs a fixed width. And everything runs in your browser. Nothing gets uploaded.

How to Use

Enter decimal numbers in the left panel, one per line. You can enter a single number or multiple numbers for batch conversion.

Choose options -- select uppercase or lowercase, 0x prefix, and zero-padding (2, 4, or 8 digit minimum width).

Click Convert or leave Live mode enabled to see hex output instantly as you type.

Copy, Download, or Swap the result. Use Swap to convert hex back to decimal.

Frequently Asked Questions

How does decimal to hex conversion work?

Decimal (base-10) uses digits 0-9, while hexadecimal (base-16) uses digits 0-9 and letters A-F. To convert, repeatedly divide the decimal number by 16 and record the remainders. The hex result is the remainders read in reverse order. For example, 255 / 16 = 15 remainder 15, which gives "FF" in hex (F = 15).

What does the padding option do?

Padding adds leading zeros to ensure the hex output has a minimum number of digits. For example, the decimal number 10 is "A" in hex. With 2-digit padding it becomes "0A", with 4-digit padding "000A", and with 8-digit padding "0000000A". This is useful when working with fixed-width hex values like color codes or memory addresses.

Can I convert multiple numbers at once?

Yes! Enter one decimal number per line for batch conversion. Each number is converted independently, and the hex results appear on corresponding lines in the output panel. Empty lines in the input are preserved in the output.

What is the 0x prefix used for?

The "0x" prefix is a convention in programming languages like C, Java, JavaScript, and Python to indicate that a number is in hexadecimal format. For example, 0xFF represents 255. Enabling this option adds "0x" before each hex value, making the output ready for use in code.

Does this tool support large numbers?

Yes! The tool uses BigInt (where available in your browser) to handle arbitrarily large numbers. This means you can convert very large decimal values beyond the standard integer limits. All modern browsers support BigInt for accurate conversion of large numbers.

Share: