Binary, hex, and decimal converter

Convert whole numbers and see how place values work.

Whole numbers only. A minus sign and a matching 0b, 0o, or 0x prefix are allowed.

Choose the input base and enter a whole number.

Preparing your result.

Tell us what happened and what you expected. Please leave out personal information and private tool inputs.

These details describe your setup. They don’t include your name, email, or anything entered into the tool.

See the details included

Voting-limit status from this browser is included. Reports are stored by Netlify so I can investigate.

The base sets each digit’s place value

Each base uses a different set of digits:

Base Digits
Binary (2) 0 and 1
Octal (8) 0 through 7
Decimal (10) 0 through 9
Hexadecimal (16) 0 through 9, then A through F

In hex, A means 10, B means 11, and so on through F, which means 15.

To read hexadecimal FF, multiply each digit by its place value, then add:

Working Decimal value
Left F: 15 × 16 240
Right F: 15 × 1 + 15
Total 255

The same value is 11111111 in binary and 377 in octal.

Whole-number limits

Each digit is multiplied by its place value, then the parts are added. The result preserves every digit, up to the 256-digit input limit. Entries of up to 16 digits also show the expanded calculation.

Fractions, exponent notation, and separators are not supported. A decimal 10 and a hexadecimal 10 represent different amounts, so choose the input base before entering or pasting a value.

FAQs

Can I enter 0x or 0b prefixes?

Yes, when they match the selected input base: 0x for hexadecimal, 0b for binary, or 0o for octal. Decimal input has no prefix.

How are negative numbers shown?

With a minus sign in every base. This does not generate two’s-complement bits, because that would also require choosing a bit width.

Will long numbers lose precision?

No. All digits are preserved, up to the 256-digit input limit.

Have an idea for a tool I should add? Send it in. I read every suggestion and choose which ones to build next.

For example: "Count the weekdays until a date, without holidays."

Please don't include your name, email, or anything personal. I don't need it. Voting-limit status from this browser is included.