Skip to content
BetterDL

Base notation

Also called: base subscript, subscript notation, 0x prefix, hex prefix

Ways of marking which base a number is written in: a subscript like 1011₂ or 2F₁₆, or a prefix in code such as 0x for hex and 0b for binary.

The string 101 could mean five, one hundred and one, or two hundred and fifty-seven, depending on the base. Base notation removes the doubt.

Subscripts, used in this course and most textbooks: write the base, in decimal, after the number. 101₂ = 5, 101₁₀ = 101, 101₁₆ = 257.

Prefixes, used in programming languages:

  • 0x for hex: 0x2F = 47
  • 0b for binary: 0b1011 = 11
  • 0o for octal in some languages: 0o17 = 15

Other markers you may see: a trailing h for hex in some assembly languages (2Fh), and # before web colors (#FF8800), which are hex.

When the base is obvious from context, such as a bit pattern in a two's complement question, the subscript is often left off. When in doubt, check before you convert. 0x10 is sixteen, not ten.

2
16¹
F
16⁰

Worked example

Example

Same digits, different bases

The digits 11 under four different markers.

  1. 1.

    11₂ = 2 + 1 = 3.

  2. 2.

    11₈ = 8 + 1 = 9.

  3. 3.

    11₁₀ = 11.

  4. 4.

    11₁₆ = 0x11 = 16 + 1 = 17.

  5. 5.

    The digits match but the values don't, so the marker matters.

Common mistakes

  • Reading 0x10 as ten.

  • Treating the subscript as part of the number's value.

  • Writing a base in its own base. Every base is 10 in itself, so subscripts are always decimal: ₁₆, not ₁₀, for hex.

Practice Base notation

Interactive questions with instant feedback and a worked solution for every wrong answer.

Learn it step by step

Base notation is taught in Number Systems.