0x, 0b and 0o prefixes, grouping separators, and a leading minus are all understood.
Decimal value
255
Convert exact integers between any bases from 2 to 36. Read binary, octal, decimal, and hexadecimal together, keep familiar prefixes and digit grouping, and inspect bit length or fixed-width two's-complement form.
Step by step
01Choose the source base
Pick a common base or set any radix from 2 through 36.
02Enter the digits
Spaces, commas, underscores, signs, and matching 0b, 0o, or 0x prefixes are accepted for practical pasted values.
03Read every common form
Binary, octal, decimal, hexadecimal, and the custom-base result update from the same exact integer.
04Check the machine view
Choose 8, 16, 32, or 64 bits to see whether a signed value fits and how its two's-complement bits look.
Worked example
Given
Place values
F × 16¹ + F × 16⁰
15 × 16 + 15 × 1
240 + 15
= 255A numeral is a sequence of digit values weighted by powers of its base. The integer stays the same; only its written representation changes.
Why this one
A base sets the available digits
Base 2 uses 0–1, base 16 uses 0–9 and A–F, and base 36 continues through Z.
Position supplies the power
Moving one place left multiplies a digit's weight by the base, exactly as decimal columns multiply by ten.
Grouping is visual only
Spaces and underscores make long numerals readable without changing their value.
Negative machine integers need a width
Two's complement depends on whether the register has 8, 16, 32, or 64 bits; the minus sign alone does not specify the bit pattern.
The judgement call
Flags, masks, and bit operations
Binary
Each written digit maps to one bit.
Compact machine values and colors
Hexadecimal
One hex digit maps cleanly to four bits.
Unix permissions
Octal
Each digit represents three permission bits.
A value for a general reader
Decimal
It is the familiar everyday notation.
Reference
FAQ
Multiply each bit by its power of two and add the results. The rightmost bit has weight 1, then 2, 4, 8, and so on.
It uses 0–9 for values zero through nine and A–Z for values ten through thirty-five.
Yes. Conversion uses arbitrary-precision integers, so large whole numbers do not lose low-order digits.
Two's complement is the standard fixed-width encoding for signed binary integers. A negative value is represented by adding it to 2 raised to the chosen width.
No. They are accepted as grouping separators and removed before parsing.
The numeral is parsed and converted entirely in your browser.
Keep going
ID Generator
Generate identifiers that use compact alphabets.
Prime Number Checker
Inspect the integer behind a numeral.
Roman Numeral Converter
Translate another historical number notation.
Base64 Encoder & Decoder
Work with a text encoding that uses a 64-character alphabet.