← 0xChallenge.com

Coding · Facts & stats

0x facts & stats

7 fact-checked facts about hexadecimal numbers and the 0x prefix, each with the reason behind it. 5 more are in today's round and join this page after it closes.

Play today's round

The basics

Which letters are used as digits in hexadecimal?

AnswerA to F

Hex needs six extra symbols beyond 0 to 9, so it borrows the first six letters of the alphabet.

What is 0x10 in decimal?

Answer16

In hex the '1' sits in the sixteens place, so 0x10 = 1 × 16 = 16.

Going deeper

How many bits does one hexadecimal digit represent?

Answer4

Sixteen values need exactly four binary digits, since 2^4 = 16.

Which prefix do Python and JavaScript use for binary number literals?

Answer0b

In both languages 0b starts a binary literal, 0o an octal one and 0x a hexadecimal one.

How many hex digits are needed to write every possible value of one byte (8 bits)?

Answer2

A byte's values run from 0x00 up to 0xFF, so two hex digits always suffice.

Expert level

What is decimal 4096 written in hexadecimal?

Answer0x1000

4096 is 16 to the power 3, which hex writes as a 1 followed by three zeros.

What is 0x2A in decimal?

Answer42

0x2A = 2 × 16 + 10 = 42.

Know these cold?Today's round is five questions like these, 20 seconds each. Your streak and level follow you to every arena.Play today's round