Skip to calculator
Veomark

Free · Instant · No signup

Binary / Decimal / Hexadecimal Interconvertible Calculator

Convert a non-negative integer among binary, decimal, and hexadecimal in the browser.

Page updated 2026-09-04.

Binary / Decimal / Hexadecimal Interconvertible Calculator visual
Sponsored

Calculator

Decimal, 0b binary, or 0x hex. Default 255.

Sponsored

One number, three equivalent bases

The decimal value 255 converts to binary 11111111 (eight 1s) and hex FF -- all three represent the exact same numeric quantity, just written in base 10, base 2, and base 16 respectively.

255 being exactly eight 1-bits in binary isn't a coincidence -- it's the maximum value representable in a single byte (2^8 - 1 = 255), which is why 255 (and its hex equivalent FF) shows up constantly in programming contexts involving byte values, color channels (like RGB's 0-255 range), and bitmasks.

Hex is popular specifically because it maps cleanly onto binary: each single hex digit represents exactly 4 binary bits, so FF (2 hex digits) directly corresponds to 11111111 (8 bits) without any awkward remainder -- a relationship that doesn't hold as cleanly between decimal and binary.

What this converter does and doesn't handle

Integers only. Leading 0b / 0x prefixes are accepted. Not a floating-point IEEE tool. This works with whole numbers only -- converting a decimal like 3.14 into binary or hex would require IEEE 754 floating-point representation rules, a substantially different and more complex conversion this integer-focused tool doesn't perform.

Standard prefixes (0b for binary, 0x for hex) are recognized as input, so pasting a value like 0xFF into the 'treat as' hex field works the same as pasting just FF -- useful since many programming contexts display values with these prefixes by default.

The 'treat as' selector determines which base the input value should be interpreted in before converting to the other two -- entering 255 as decimal versus entering 255 as if it were already binary (which isn't valid, since binary only uses 0 and 1) would produce very different, and in some cases invalid, results.

Related number-base and encoding tools

For converting an IPv4 address specifically (rather than an arbitrary integer) between hex, binary, and decimal, the IP Address Hex/Binary Converter handles that specific 32-bit case.

For converting time values into decimal hours instead of number bases, the Time to Decimal Hours Converter is a different, unrelated conversion need some users are actually looking for.

Frequently Asked Questions (FAQ)

Why does decimal 255 become exactly eight 1s in binary?

255 is the maximum value representable in a single 8-bit byte (2^8 - 1 = 255), and the binary representation of that maximum value is all eight bits set to 1 (11111111) -- there's no remaining 'room' left, which is why it's exactly eight 1s rather than a mix of 0s and 1s.

Why does hex FF correspond so cleanly to binary 11111111?

Each single hex digit represents exactly 4 binary bits, so a 2-digit hex number represents exactly 8 bits (1 byte). F in hex is 1111 in binary, so FF (two F digits) is 1111 1111, matching 11111111 exactly -- this clean 4-bits-per-digit relationship is why hex is commonly used to represent byte and binary values compactly.

Does this converter handle decimal numbers with a fractional part, like 3.14?

No. Integers only. Leading 0b / 0x prefixes are accepted. Not a floating-point IEEE tool. Converting a fractional decimal number into binary or hex requires IEEE 754 floating-point representation, a substantially more complex conversion this integer-only tool doesn't perform.

Can I paste a value with a 0x or 0b prefix directly?

Yes. Integers only. Leading 0b / 0x prefixes are accepted. Not a floating-point IEEE tool. The tool recognizes and correctly interprets standard 0x (hex) and 0b (binary) prefixes, so pasting a prefixed value like 0xFF works the same as entering just FF with hex selected as the input base.

What does the 'treat as' selector actually control?

It tells the converter which base your input value is already written in, before converting it to the other two bases. Entering the same digits (like 255) as decimal versus as another base would be interpreted completely differently -- getting this selector right is essential for a correct conversion.