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

Decimal uses ten digits, 0 through 9. Binary uses 0 and 1; octal uses 0 through 7; hexadecimal uses 0 through 9 followed by A through F. In hex, A means ten and F means fifteen.

For hexadecimal FF, the left F contributes 15 × 16¹, and the right F contributes 15 × 16⁰. Together, 240 + 15 = 255 in decimal. That same value is 11111111 in binary and 377 in octal.

Exact integers, without a bit-width assumption

The tool reads each digit, multiplies the accumulated total by the input base, and adds the next digit. It then expresses that exact integer in all four bases. Short entries include the expanded place-value sum; longer entries use the same method without printing hundreds of terms.

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. Integer arithmetic preserves every digit within the input limit. The result is not converted through floating-point arithmetic.

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.