HomeToolsDeveloper Tools › Number Base Converter

Number Base Converter

Convert between binary, decimal, hexadecimal, and octal instantly. Type in any field — the other three update live. Copy with one click. No signup, no install.

All conversion runs in your browser — no data is sent to any server.
Binary Base 2
Valid: 0 and 1
Decimal Base 10
Valid: 0–9, optional − prefix
Hexadecimal Base 16
Valid: 0–9, A–F (auto-uppercased)
Octal Base 8
Valid: 0–7

About Number Base Converter

The AT USE Number Base Converter converts integers between binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). All four fields update simultaneously as you type in any one of them. Type a decimal number and the binary, octal, and hex representations appear instantly. Type a hex value and the decimal equivalent fills in. No submit button, no page load, no server request.

The conversion engine uses JavaScript's native BigInt type. Standard IEEE 754 floating-point numbers lose precision on integers above 253 — about 9 quadrillion — which is below the range of a 64-bit integer. BigInt eliminates that ceiling. You can enter a 64-bit value like 18446744073709551615 (the maximum unsigned 64-bit integer, or 0xFFFFFFFFFFFFFFFF in hex) and get an exact binary representation of all 64 bits. No rounding, no silent truncation.

Two's complement mode

Enable Two's Complement and select a bit width (8, 16, 32, or 64 bits) to see signed integer representations. Positive numbers are unchanged. Negative decimals are encoded as their two's complement binary form. For example, at 8-bit width: -1 becomes 11111111, -128 becomes 10000000, -127 becomes 10000001. The most significant bit acts as the sign bit: 0 means positive, 1 means negative. Switching bit width updates the result immediately, which lets you compare how the same value is encoded in different word sizes without re-entering the number.

This is useful when reading debugger output that reports register values as unsigned hex. Enter the hex value, enable two's complement at 32-bit, and read the signed decimal to know if the register holds a negative value. Embedded and firmware developers do this regularly when inspecting signed counters, ADC readings, or return codes stored in hardware registers.

Display options

The Prefix toggle adds standard notation to the output: 0b before binary values, 0o before octal, 0x before hexadecimal. These prefixes are recognized by C, C++, Python, JavaScript, Rust, and Go — enabling prefix mode lets you copy values directly into source code without adding the prefix manually.

The Group toggle splits binary output into 4-bit nibbles separated by spaces. A 16-bit value like 1011000011001010 becomes 1011 0000 1100 1010. Grouping makes it easier to read bit patterns and to count the position of a specific bit. Nibble boundaries also align with hex digits, which helps when correlating binary and hex representations of the same value.

Copy buttons

Each of the four base fields has a dedicated copy button. Click it to copy the current value (with prefix if enabled) to the clipboard. The button briefly shows "Copied" to confirm the action completed. All conversion runs in the browser: no value ever leaves your device, which makes the tool safe for converting internal addresses, encryption keys, or other sensitive numeric data.

Frequently asked questions

Why use BigInt instead of regular JavaScript numbers?

Standard JavaScript numbers (IEEE 754 double-precision floats) can represent integers exactly only up to 2^53 - 1, which is 9,007,199,254,740,991. Above that limit, values are rounded to the nearest representable float. 64-bit integers go up to 18,446,744,073,709,551,615 (unsigned) or 9,223,372,036,854,775,807 (signed), both well above that ceiling. BigInt handles exact 64-bit arithmetic without rounding. For embedded or systems work where 64-bit values are routine, this matters.

What does the bit-width setting do in two's complement mode?

8-bit two's complement covers -128 to 127. 16-bit covers -32,768 to 32,767. 32-bit covers approximately -2.1 billion to +2.1 billion. 64-bit covers approximately -9.2 x 10^18 to +9.2 x 10^18. Entering a value outside the selected range shows an error. The width setting lets you model the exact storage format your target platform uses without recalculating bounds manually.

What do the 0b, 0o, and 0x prefixes mean?

0b is the prefix for binary literals in C (C23), C++14+, Python, JavaScript, and Go. 0o is the prefix for octal in Python 3 and ES6+. 0x is the prefix for hexadecimal in C, C++, Python, JavaScript, Go, and most other languages. Enabling the Prefix toggle adds these to the output so you can copy values directly into code without modification.

Why does the Group toggle split binary into groups of 4?

Groups of 4 bits (nibbles) align exactly with hexadecimal digits. Each hex digit represents one nibble: 0-9 plus A-F covers 0000 to 1111. Grouping binary output into nibbles makes it easy to read the hex equivalent directly from the binary and to identify the position of individual bits. For example, the 8-bit value 10110010 grouped as 1011 0010 corresponds immediately to hex B2.

Can I type values with prefixes in the input?

Yes. You can type 0xFF into the hex field (or just FF), 0b1010 into the binary field, or 0o17 into the octal field. The tool strips the prefix before parsing. You can also type negative decimals directly: -42 in the decimal field shows the unsigned hex and binary equivalents, and the signed two's complement value when that mode is enabled.

Does this tool send my values to a server?

No. All conversion runs in JavaScript in the browser. Nothing is transmitted. The page works offline after it loads for the first time. This makes it safe to use with internal memory addresses, license keys, cryptographic values, or any numeric data you would not want logged on a remote server.

Also try

Related tools