🧰 ToolPicoAll Tools →
Binary · Octal · Decimal · Hexadecimal · Base 2-36

Number Base Converter

Convert instantly between binary, octal, decimal, hexadecimal, and any two bases from 2 to 36. Shows all 4 major bases at once, with a step-by-step division/multiplication method, bit grouping (nibble/byte), and support for negative and decimal numbers.

Quick answerA number base converter changes a number from one base system (e.g. binary-2) into another (e.g. hex-16). This tool supports every base from 2 to 36; it shows the number you enter as binary, octal, decimal, and hexadecimal at the same time, and calculates the step-by-step division/multiplication method, bit grouping, negative and fractional parts, and two's complement.

42 (dec) = 101010 (bin) 255 (dec) = FF (hex) Base 2-36 supported Step-by-step + bit grouping Updated: Jul 22, 2026
Use a leading "-" for negative numbers and "." for a decimal part (e.g. -1a.4f for base 16). Letters are not case-sensitive.
Click any cell to flip that bit (0↔1). If the most significant bit (MSB, leftmost) is 1, the number is negative under the two's complement interpretation.
In "Code → Text" mode, separate codes with spaces (e.g. 48 65 6c — in hexadecimal).
⚙️ Advanced settings — decimal precision, uppercase, step display
Uppercase hexadecimalTurn off for a-f instead of A-F
Show step-by-step solutionDivision/multiplication method details
42 (decimal) → binary
255 (decimal) → hex
2 – 36Supported base range
No digit limit (BigInt)
⚙️ Accuracy note: All calculations use JavaScript's arbitrary-precision BigInt arithmetic, so even very large integers have no rounding error. Fractional (decimal) parts are calculated up to the number of digits chosen in Advanced settings — some fractions are infinite (repeating) in the target base. Two's complement (Bit Click tab) is computed at the selected fixed bit width (8/16/32/64).

What is number base conversion, and how is it done?

A step-by-step explanation of binary, octal, decimal, hexadecimal, and general base conversions, including the division/multiplication method and bit grouping.

A number base (radix) is the count of distinct digits used in a number system. The decimal (base-10) system we use every day has 10 digits, 0-9. Computers use the binary (base-2) system because hardware can only reliably distinguish two states (on/off); octal (base-8) and hexadecimal (base-16) act as "shortcuts" for writing binary numbers compactly (each octal digit maps to 3 bits, each hex digit to 4 bits).

How do you convert decimal to binary? (division method)

Quick answerRepeatedly divide the number by the target base (e.g. 2); record the remainder at each step. Continue until the quotient reaches 0; reading the remainders in reverse order gives the result. Example: 42 ÷ 2 = 21 remainder 0; 21 ÷ 2 = 10 remainder 1; 10 ÷ 2 = 5 remainder 0; 5 ÷ 2 = 2 remainder 1; 2 ÷ 2 = 1 remainder 0; 1 ÷ 2 = 0 remainder 1 → read in reverse, 101010.

The "Convert" tab above lists these steps automatically; precision never degrades even with very large numbers, thanks to BigInt.

How do you convert binary to decimal? (positional weight method)

Quick answerMultiply each digit, from right to left, by an increasing power of 2 (2⁰, 2¹, 2², …) and add the results. Example: 101010(2) = 1×32 + 0×16 + 1×8 + 0×4 + 1×2 + 0×1 = 32+8+2 = 42(10). The same method applies to any base — just use powers of the target base instead.

What is bit grouping (nibble / byte), and why does it matter?

Binary numbers get long, so for readability they're split into groups of 4 (nibble) or 8 (byte). For example, writing 1111 1111 instead of 11111111 makes it visually clear that this is a single byte (8 bits). This tool automatically shows every result grouped by both nibble and byte.

How do you convert negative and decimal numbers to other bases?

Quick answerIn mathematical notation, a negative number gets a leading "-" and its absolute value is converted normally. The decimal (fractional) part is converted by repeatedly multiplying by the target base: the integer part of each multiplication becomes a digit. The hardware representation computers actually use for negative numbers is two's complement at a fixed bit width — you'll find it on the "Bit Click" tab above.

Example conversion table

Common numbers in four number bases
DecimalBinaryOctalHex

Popular base conversions

Direct links to commonly searched conversions — clicking one auto-fills the calculator and computes instantly.

Related mini tools: color, bit width, parity & Roman numerals

Four additional calculations commonly used alongside number bases — all instant, in your browser.

🎨Hex → Color
Converts a hex color code (3 or 6 digits) into decimal RGB values with a live preview.
📏How many bits needed?
The minimum number of unsigned/signed bits needed to store a decimal number.
🧮Parity bit
Calculates the even/odd parity bit based on the number of 1s in the binary representation.
🏛️Roman numerals
Converts a decimal number (1-3999) to Roman numerals, or a Roman numeral back to decimal.
📐IEEE 754 Float
Breaks a decimal number down into its IEEE 754 sign, exponent, and mantissa bits (single 32-bit precision).

Reference tables & quick facts

Citable reference tables generated by the calculator engine: a 0-32 base table, powers of 2, an ASCII table, and programming base prefixes.

Binary / octal / hex equivalents from 0 to 32
DecimalBinaryOctalHex

Generated live by this tool's engine; since positional number systems never change, this is an evergreen reference.

Powers of 2 (frequently used in bit-width calculations)
ExponentValue (decimal)Hex

2⁸=256 (byte limit), 2¹⁶=65,536 (16-bit limit), 2³²≈4.29 billion (32-bit limit) — used as a reference for bit-width and overflow calculations.

Printable ASCII characters (32-126)
CharacterDecimalHexOctalBinary

The ASCII standard hasn't changed since 1963; code 32 is the space character. Full text can also be converted using the "Text ↔ Bytes" tab.

Base literal prefixes across programming languages
BasePrefixExample
Binary (2)0b0b101010
Octal (8)0o (just 0 in some languages)0o52
Hex (16)0x0x2A
CSS color (16, 6-digit)##2A2A2A

These prefixes tell the compiler/interpreter which base a literal number written in source code is in.

Number base terms glossary

Short definitions of the core concepts used in base conversion.

Base (radix)The count of distinct digits used in a number system. Decimal uses 10, binary uses 2.
DigitA single symbol in a number; it carries a "place value" (a power of the base) based on its position.
BitA single digit in the binary system; takes the value 0 or 1. Short for "binary digit."
NibbleA group of 4 bits; corresponds to exactly one hexadecimal digit (0-F).
ByteA group of 8 bits; the basic unit of computer memory (value range 0-255).
MSB / LSBMost significant bit (leftmost) and least significant bit (rightmost).
Two's complementThe method used to store negative numbers at a fixed bit width: invert every bit, then add 1.
Signed / unsigned integerUnsigned holds only positive values; signed uses the MSB as a sign bit.
OverflowWhen a number is too large or too small to fit in the allotted bit width.
ASCIIAn old, universal standard that represents letters, digits, and symbols as integer codes 0-127.
Unicode code pointA unique integer assigned to every character (including emoji); an extension of ASCII.
Parity bitAn extra bit added for data-integrity checking; it makes the count of 1s either even or odd.

In-depth guides

Detailed answers to the most commonly asked questions about number bases.

What is 255 in different number bases? (why it matters for color codes)

The number 255 is 11111111 in binary (8 bits, a single byte), 377 in octal, and FF in hexadecimal. Since it's the highest unsigned value a single byte can hold, 255 is a frequently encountered boundary value in computer science.

In web color codes (#RRGGBB), each color channel (red, green, blue) is expressed as a value from 0-255 — exactly 8 bits — which is why #FFFFFF is white and #000000 is black. You can convert any hex color to RGB with the "Hex → Color" mini tool above.

Why do computers use the binary system?

Transistors, the fundamental building block of computers, can reliably distinguish only two stable electrical states: current present (1) or absent (0). Reliably distinguishing ten different voltage levels (for a decimal system) would be far more fragile against electrical noise.

That's why all data — numbers, text, images, sound — is stored as binary at the hardware level; hexadecimal and octal representations are simply human-readable shortcuts for that same binary data — the actual hardware is always binary.

How are negative numbers stored in a computer? (two's complement)

Computers store negative numbers using two's complement: the bits of the positive number are inverted (NOT), and 1 is added to the result. For example, at 8 bits, if +5 = 00000101, then -5 = 11111011 (00000101 inverted is 11111010, +1 = 11111011).

The advantage of this method is that addition and subtraction can use the same circuitry regardless of sign. If the most significant bit (MSB) is 1, the number is negative. You can watch this conversion live on the "Bit Click" tab above by choosing a width and clicking bits, or entering a decimal value.

Add this calculator to your site (embed code)

Embed the number base converter on your own website for free. Copy the code below into your HTML — the tool runs in a simplified view and links back to this page as its source.

The embedded tool has a fixed layout; you can adjust the height value to fit your site. No ads or personal data, runs entirely client-side.

Frequently asked questions

What is the binary number system?
The binary number system is a base-2 system that uses only the digits 0 and 1. Computers use binary because they represent data using the on/off states of electronic switches. Each digit represents an increasing power of 2 (2⁰, 2¹, 2²...) from right to left. For example, 1010(2) = 8+2 = 10(10).
What is hexadecimal?
Hexadecimal (hex) is a base-16 system that uses the digits 0-9 plus the letters A-F for the values 10-15. Because each hex digit corresponds to exactly 4 bits, it's widely used in programming and color codes (#FF5733) as a compact way to write long binary numbers.
How do you convert between binary and decimal?
To convert decimal to binary, repeatedly divide by 2, record the remainders, and read them in reverse order. To convert binary to decimal, multiply each digit by the matching power of 2 and add. This tool shows both directions step by step in the "Convert" tab.
How do you convert hex to decimal?
Multiply each digit, from right to left, by an increasing power of 16 (16⁰, 16¹, 16²...) and add the results; letter digits (A-F) correspond to values 10-15. For example, FF(16) = 15×16 + 15 = 255(10). In reverse, the number is repeatedly divided by 16 and the remainders are read in reverse order.
What is number base conversion, and how many bases are there?
A number base (radix) is the count of distinct digits used in a system. Mathematically, any base from 2 to 36 can be defined (beyond 36 the Latin letters run out). The most common are binary (2), octal (8), decimal (10), and hexadecimal (16).
How do you convert from base 2 to base 10?
To go from base 2 (binary) to base 10 (decimal), multiply each digit, starting from the right, by an increasing power of 2 (0,1,2,3...) and add the results. Example: 11001(2) = 16+8+1 = 25(10). Just set the source base to 2 and the target base to 10 in the "Convert" tab and type the number.
How are negative numbers written in binary? What is two's complement?
In mathematical notation, a negative binary number gets a leading "-". The method used in hardware is two's complement: at a fixed bit width, every bit is inverted and 1 is added; if the MSB is 1, the number is negative. The "Bit Click" tab instantly shows both the unsigned and signed value at the chosen width.
How do you convert decimal (fractional) numbers to other bases?
The fractional part is converted by repeatedly multiplying by the target base: the integer part of each product becomes a digit, and the remaining fraction is multiplied again. Some fractions are infinite (repeating) in the target base; this tool gives a precise result up to the number of digits chosen in "Advanced settings."
How do you convert text to Base64, and is Base64 a number base?
Base64 is an encoding scheme, not a true positional number base: it takes the raw UTF-8 bytes of your text and represents every group of 3 bytes as 4 characters from a 64-character alphabet (A-Z, a-z, 0-9, +, /), padding with "=" at the end when needed. It's commonly used to safely embed binary data in text formats like emails, JSON, and data URIs. Use the "Text ↔ Bytes" tab's "Text → Base64" and "Base64 → Text" modes above to convert instantly, entirely in your browser.

Methodology & sources

ToolPico's Number Base Converter is a free, independent tool. The calculation engine runs entirely in your browser using JavaScript's BigInt (arbitrary-precision integer) type, so even very large numbers have no rounding error. The integer part is calculated with the division-remainder method, the fractional part with the multiplication method — the standard algorithm taught in elementary and secondary math/computer science curricula. The two's complement calculation follows the standard binary signed-integer representation convention.

Basis: Positional number system theory (standard mathematics) · the ASCII character encoding standard · the two's complement representation convention. This information is evergreen (it does not change year to year). Last updated: July 22, 2026. Results are for informational and educational purposes only; for cryptographic, hardware, or safety-critical applications, verify against a formal specification.

🔗 Add this tool to your site

Copy the code below into your own site. The tool is free, always up to date, and runs entirely on your page. No sign-up required.

Preview →
⚡ Built with ToolPico · toolpico.com