SahlCalc سهل
Gulf Hubs:

Saudi Arabia: Labour: HRSD · Tax and zakat: ZATCA

Hex Calculator

Convert numbers between hexadecimal, decimal and binary with the working shown, or do arithmetic directly in hex.

What to do

Number is in

Written in the system chosen above, e.g. 1F4 (hex), 500 or 111110100

Decimal

500

Hexadecimal

1F4

Decimal

500

Binary

1 1111 0100

Octal

764

Place values (3)
DigitValuePlace valueProduct
1116² = 256256
F1516¹ = 16240
4416⁰ = 14

Formula with your numbers

  • Place values 1F4₁₆ = 1×16² + 15×16¹ + 4×16⁰ = 256 + 240 + 4 = 500

Quick answer: 1F4 in hex is 500 in decimal: 1×16² + 15×16¹ + 4×16⁰ = 256 + 240 + 4 = 500.

How it's calculated

Hexadecimal is base 16. It uses the digits 0–9 and the letters A–F for 10–15, and each place is worth a power of 16: 16⁰ = 1, 16¹ = 16, 16² = 256.

Hex to decimal: multiply each digit by its place value and add. Decimal to hex: divide by 16 repeatedly and read the remainders from the last to the first.

Hex and binary convert digit by digit, because 16 = 2⁴: each hex digit is exactly 4 bits, so 1F4 = 0001 1111 0100. This is why hex is used for colours (#FF8800), memory addresses and byte values. For base 2 on its own, use the binary calculator.

Worked examples

  • Hex to decimal: 1F4₁₆ = 256 + 240 + 4 = 500
  • Decimal to hex: 255 = FF₁₆
  • Hex addition: FF₁₆ + 1A₁₆ = 119₁₆ (255 + 26 = 281)

Hex digits

HexDecimalBinary
991001
A101010
B111011
C121100
D131101
E141110
F151111
10161 0000
FF2551111 1111

Frequently asked questions

What does 0x mean?

It is a prefix that marks a number as hexadecimal in programming, as in 0x1F4. You can type it or leave it out.

How is a colour like #FF8800 read?

As three bytes: red FF = 255, green 88 = 136 and blue 00 = 0.

Are lower-case letters allowed?

Yes. 1f4 and 1F4 are the same number; results are shown in upper case.

What is 1F4 in decimal?

500. That's 1 lot of 256, 15 lots of 16, and 4.

What is FF + 1A in hex?

119, which is 255 + 26 = 281 in everyday numbers.

How do I turn an RGB colour into hex?

Write red, green and blue (each 0 to 255) as two hex digits each. rgb(255, 136, 0) becomes #FF8800.