Number Base Converter
Convert between binary, octal, decimal and hexadecimal in one glance.
The Number Base Converter translates any integer between the four bases that matter in computing: binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16). Type a number in any of them — prefixes like 0xFF, 0b1010 and 0o17 are accepted automatically — and see the same value in all four bases at once.
Developers meet these conversions constantly: color codes like #FF5733 are hex bytes, network masks and permissions are octal, bitmasks and registers are binary, and error codes come back in hex from the strangest places. Being fluent means seeing 0xFF as 255 and 0b11111111 instantly, and this tool builds that fluency by showing every representation side by side with one-click copy.
Conversion is exact for integers up to JavaScript's safe range (2⁵³ − 1 ≈ 9.007 × 10¹⁵); larger values trigger a clear warning instead of a silently wrong answer. Everything runs locally in your browser.
Prefixes like 0x, 0b or 0o are accepted and auto-detected.
111111110b111111113770o377255FF0xFFDecimal value: 255 · needs 8 bits in binary. Hex letters are shown uppercase.
How to use the Number Base Converter
- Type a number in any base — 255, 0xFF, 0b11111111 or 0o377 all work.
- If the number has no prefix, choose its base from the dropdown.
- Read the same value in binary, octal, decimal and hexadecimal simultaneously.
- Copy any representation with one click.
- Note the bit count — how many binary digits the value needs.
Frequently asked questions
How do I convert hexadecimal to decimal?
Multiply digit by digit by powers of 16: 0xFF = 15×16 + 15 = 255. This converter does it instantly and shows all four bases, so you can verify the result: 0xFF = 255 = 0b11111111 = 0o377.
What are bases 2, 8, 10 and 16?
Binary (base 2) uses digits 0–1, the language of transistors. Octal (base 8) uses 0–7, historically used for Unix permissions. Decimal (base 10) is everyday arithmetic. Hexadecimal (base 16) uses 0–9 plus A–F, a compact way to write bytes — two hex digits per byte — used in colors, memory addresses and networking.
Why do programmers use hexadecimal so much?
Because one hex digit maps cleanly to four bits and two hex digits to exactly one byte. A 32-bit address like 0x7FFFFFFF is far easier to read and spot-check than its 32-character binary form, and converting between them is trivial.
What happens if my number is too large?
JavaScript numbers are exact only up to 2⁵³ − 1 (about 9.007 × 10¹⁵). Beyond that, binary/octal/hex conversions can lose precision, so the tool shows a warning rather than returning a subtly wrong result.
Related tools
View all unit converters →Length Converter
Convert between metric and imperial lengths: mm to inches, km to miles and more.
ConvertersWeight Converter
Convert kilograms, pounds, ounces, grams, stones and tons instantly.
ConvertersHeight Converter
Height in cm, meters or feet & inches — with the feet-inches split done for you.
ConvertersTemperature Converter
Convert Celsius, Fahrenheit, Kelvin and Rankine with one click.
ConvertersArea Converter
Convert square meters, square feet, acres, hectares and more.
ConvertersVolume Converter
Convert liters, gallons (US & UK), cups, cubic feet, barrels and more.