Skip to main content
NB

Number Base Converter

Convert numbers between any base from 2 to 36 — binary, octal, decimal, hexadecimal or any custom base — instantly.

Did you like the tool? Thanks!
Share:

Binary (base 2)
Octal (base 8)
Decimal (base 10)
Hexadecimal (base 16)

Supports any base from 2 to 36, using digits 0-9 then letters a-z.

How to Use Number Base Converter

Type a number, choose its current base (from base 2 to base 36) and the base you want to convert it to. The calculator validates your digits, shows the converted result, and displays a quick reference table with binary, octal, decimal and hexadecimal equivalents.

About Number Base Converter

Every number system represents quantities using a fixed set of digit symbols and a "base" that determines how many unique digits exist before you carry over to the next place value. The decimal system everyone learns in school is base 10, using digits 0-9. Computers, however, natively work in base 2 (binary, digits 0-1), and programmers frequently use base 8 (octal) and base 16 (hexadecimal, digits 0-9 then A-F) as more compact, human-readable shorthand for binary data, since each hex digit corresponds cleanly to exactly four binary digits. This converter handles any base from 2 to 36 — base 36 being the practical maximum since it uses every digit (0-9) plus every letter of the alphabet (A-Z) as a single-digit symbol. The conversion process fundamentally goes through decimal as an intermediate step, even though the interface hides that detail. To convert a number from its source base into decimal, each digit is multiplied by the base raised to the power of its position (counting from zero on the right), and the results are summed. For example, hexadecimal "FF" equals F×16¹ + F×16⁰ = 15×16 + 15×1 = 240 + 15 = 255 in decimal. To then convert that decimal value into a different target base, the number is repeatedly divided by the target base, with each remainder becoming a digit, read in reverse order from last remainder to first. Worked example: converting decimal 255 to binary. 255 ÷ 2 = 127 remainder 1. 127 ÷ 2 = 63 remainder 1. 63 ÷ 2 = 31 remainder 1. Continuing this process down to zero and reading the remainders bottom-to-top gives 11111111 — eight 1s, which makes sense since 255 is the maximum value representable in 8 bits (one full byte). A common misconception is that any string of digits is valid in any base — for example, assuming "89" is a valid binary number. In reality, a valid digit in base N must be strictly less than N: binary only allows 0 and 1, octal only allows 0-7, and so on, which is why "89" is invalid in binary or octal (8 and 9 are not legal digits in either system) but perfectly valid in decimal or any higher base. This converter validates every digit against the allowed character set for the chosen base before attempting conversion, catching exactly this class of mistake with a clear error message instead of producing a silently wrong answer.

Details & Tips

Validation: for a given base N, the set of allowed digit characters is the first N characters of "0123456789abcdefghijklmnopqrstuvwxyz" (case-insensitive) — base 2 allows only 0-1, base 16 allows 0-9 and a-f, base 36 allows the full 0-9 and a-z. Every character in the input is checked against this set before any conversion is attempted, catching invalid input like "2" in binary or "G" in hexadecimal immediately. Conversion: the validated input string is parsed from its source base into a native decimal number, then that decimal number is converted into a string representation in the target base. A quick-reference table simultaneously shows the same value converted to binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16), recalculated live whenever the input or input base changes. Worked example 1: converting hex "1A3" to decimal. 1×16² + A×16¹ + 3×16⁰ = 1×256 + 10×16 + 3×1 = 256 + 160 + 3 = 419. Worked example 2: converting decimal 100 to base 5. 100 ÷ 5 = 20 remainder 0. 20 ÷ 5 = 4 remainder 0. 4 ÷ 5 = 0 remainder 4. Reading remainders bottom to top: 400 in base 5 (verify: 4×25 + 0×5 + 0×1 = 100, correct). Edge cases the widget handles: an empty input suppresses all results rather than showing a misleading zero; a negative sign is accepted as a valid leading character and preserved through the conversion; entering a digit that is invalid for the currently selected input base (for example, "9" while base 2 is selected) shows a specific inline error naming the offending character and the base, rather than a generic failure message; switching the input base after typing a value re-validates immediately, since a string valid in base 16 may not be valid in base 8. Practical tip: hexadecimal is the most common non-decimal base encountered in everyday computing contexts — color codes on the web (#FF5733), memory addresses, and MAC addresses are all typically written in hex specifically because it packs binary data into a much shorter, more readable string than binary itself while still converting cleanly (each hex digit maps to exactly 4 binary digits, unlike decimal, which does not divide evenly into binary place values). If you are debugging code and see an unfamiliar number system prefix like 0x (hex) or 0b (binary) in source code, that prefix is a language convention indicating the base — strip it before entering the number into this converter's value field.

Frequently Asked Questions

How do I convert binary to decimal?
Set the input base to 2 and the output base to 10, then type your binary number — the calculator converts it instantly, and also shows the decimal value in the quick reference table.
What bases does this converter support?
Any base from 2 to 36, covering everything from binary (base 2) through hexadecimal (base 16) up to base 36, which uses digits 0-9 and letters A-Z.
Why is "89" invalid in binary?
Binary only allows the digits 0 and 1; any digit of 2 or higher, including 8 and 9, is not a legal binary digit, so the calculator flags it as invalid input.
What is hexadecimal used for?
Hexadecimal (base 16) is widely used in computing for color codes, memory addresses and data representation because each hex digit corresponds exactly to 4 binary digits, making it a compact, readable shorthand for binary data.
How do I convert hex to binary?
Set the input base to 16 and output base to 2, type your hex value, and the converter shows the binary equivalent; the quick reference table also shows binary automatically for any valid input.
Can I convert negative numbers?
Yes, a leading minus sign is accepted and preserved through the conversion process for any supported base.
What is the maximum base this converter supports?
Base 36, which is the practical maximum since it uses all 10 digits (0-9) plus all 26 letters of the alphabet (A-Z) as single-digit symbols — there are no more standard characters to represent higher bases.
Why does the converter show a reference table?
The binary, octal, decimal and hexadecimal reference table lets you see your number in the four most commonly used bases simultaneously, without needing to change the output base repeatedly.
What letters are valid in base 16 (hexadecimal)?
Hexadecimal uses digits 0-9 plus letters A through F (case-insensitive) to represent values 10 through 15 as single characters.
Why did my conversion show an error?
The calculator validates every character in your input against the digit set allowed for your selected input base — if a character falls outside that set (for example, "F" while base 10 is selected), it shows a specific error naming the invalid character.

Part of These Collections

Also Available As

number base converter, binary to decimal converter, hex to decimal converter, base converter, radix converter, decimal to binary converter

Found a Problem?

Let us know if something with Number Base Converter isn't working as expected.

Thanks — we'll take a look.