Free tools that run in your browser. Use any tool without an account.

Favourites Cart
Sign in
Join free

Decimal to Hex Converter

  • Free
  • Runs in your browser
  • No account needed

Type a decimal number and the tool shows its hexadecimal, 0x form, binary and octal instantly. For negatives you can select 8/16/32/64 bit two's complement. Example: 4095 becomes FFF (0xFFF).

Hexadecimal
FFF
With 0x prefix
0xFFF
Binary
1111 1111 1111
Octal
7777
Runs in your browser. Your files and values are not sent to us. Report a problem
Advertisement

About the Decimal to Hex Converter

FreeToolr's Decimal to Hex Converter converts decimal integers to hexadecimal, 0x prefix, binary and octal directly in your browser. You enter a decimal number and pick a bit width for negative values (8, 16, 32 or 64). Results update as you type; there is no calculate button. The page runs client-side and nothing is uploaded, so it still works after the page has loaded. Negative numbers show two's complement at the chosen width using 2^bits + number. You can copy the outputs or share a link that reopens with your input. This tool focuses on quick, clear conversions rather than bulk CSV imports or extended formatting options, so it is handy for students, developers checking bytes, and engineers working with fixed-width integers.

How to use it

  1. 1Enter a decimal number in the input field.
  2. 2Select a width for negative numbers: 8 bits, 16 bits, 32 bits, or 64 bits.
  3. 3Read the outputs: Hexadecimal, Hex with 0x prefix, Binary and Octal.
  4. 4Copy a result or create a share link that reopens with your numbers.
Advertisement

Worked example

Input: 4095. Result: Hexadecimal = FFF, With 0x prefix = 0xFFF, Binary = 111111111111, Octal = 7777.

How it works

Divide by 16 again and again; the remainders read from last to first are the hex digits (10 to 15 become A to F)4095 / 16 = 255 r 15, 255 / 16 = 15 r 15, 15 / 16 = 0 r 15, so 4095 = FFF

Source: RFC 4648 - Base16 (hex) alphabet and usageDecimal to Hex conversion method and examples. Last checked 7 November 2026.

What it is good for

  • Instant, in-browser conversion with no upload required.
  • Shows Hex, 0x-prefixed Hex, Binary and Octal at once.
  • Two's complement output for negatives at 8/16/32/64 bit widths.
  • Only single decimal inputs are supported; no batch or CSV import.
  • Fractional hex fractions are not produced by this tool.
Advertisement

Questions people ask

How do I convert a decimal number to hex?

Repeatedly divide the non-negative integer by 16. Record each remainder (0 to 15) and map 10 to 15 to A, F. Read the remainders in reverse order to get the hex digits.

What is 255 in hex?

255 in hexadecimal is FF. You will often see it written as 0xFF in code or documentation.

Does letter case A, F matter in hex?

No. Hex digits are case-insensitive; A, F and a, f mean the same values. The choice of upper or lower case is a formatting preference.

How are negative numbers shown?

Negative numbers are shown in two's complement at the chosen width. The converter uses 2^bits plus the negative number to produce the fixed-width hex representation used by many programming languages and hardware.

Can I convert decimal fractions with this tool?

This tool focuses on integer conversions and does not produce hex fractions. Converting fractional parts uses repeated multiplication by 16 and can produce recurring hex digits, which other tools or calculators handle.

How many hex digits represent one byte?

One byte uses two hex digits, ranging from 00 to FF. For example, decimal 255 maps to 0xFF which fits in a single byte.

Help keep every tool free

FreeToolr stays free because people help it grow. Share a tool you like, tell us what to build next, or support us on Ko-fi.

Advertisement
Advertisement