Number base converter. Binary, hex, octal, decimal, live.
Runs entirely in your browser, nothing is uploaded. Conversion uses BigInt, so arbitrarily large integers are exact.
How to use the Number Base Converter
This converter shows one whole number in four bases at once: decimal, hexadecimal, octal and binary. Type in any of the four fields and the other three are rewritten as you type, using exact big integer math, so very long numbers do not round. It is meant for developers and students checking bit patterns, hex values and permissions.
Step by step
-
Type a number in any field
Enter a value in Decimal, Hexadecimal, Octal or Binary. The other three fields update on every keystroke. Press Load sample to fill in 255 if you want to see the layout first.
-
Use only the digits of that base
Decimal takes 0 to 9, Hexadecimal takes 0 to 9 and a to f in either case, Octal takes 0 to 7 and Binary takes 0 and 1. Spaces are ignored, so 1111 0000 works. A prefix such as 0x or 0b is not accepted and shows Invalid digit for base 16 or base 2.
-
Add a minus sign for negative numbers
Start the value with a minus sign to convert a negative number. Every field keeps the minus sign in front. Fractions are not supported, so a decimal point counts as an invalid digit.
-
Read the stats and the nibbles
Under the fields, the stats show the bit length, the byte length and whether the value is positive, negative or zero. The box titled binary, grouped in nibbles (4 bits) splits the binary form into groups of four, padded with leading zeros.
-
Copy what you need
Press the small copy icon at the right of any field to copy that field's value. Press Copy above the nibble box to copy the padded binary. Clear all empties every field.
Reading the result
- With 255 in Decimal you get ff in Hexadecimal, 377 in Octal and 11111111 in Binary. Hex output is always written in lower case.
- The stats for 255 read 8 bits, 1 byte and value positive. Byte length is the bit length divided by 8, rounded up, so 256 needs 9 bits and 2 bytes.
- Each nibble of four bits matches exactly one hex digit, so 1111 1111 lines up with f f. Every second group is tinted to make long values easier to scan.
- For a negative number the Binary field shows a minus sign in front of the bits of the absolute value (sign magnitude), not two's complement, and the nibble box shows the absolute value only. A note under the nibbles says so.
Tips and common mistakes
- Strip prefixes before pasting. Remove 0x from hex values and 0b from binary values, or the field shows an error.
- The copied nibble string has no spaces between groups; the gaps are only visual.
- This tool does not show two's complement. For a negative value you see sign magnitude, which is not how a CPU stores it in a fixed width register.
- Unix permissions such as 755 are octal. Type 755 in Octal and the Binary field shows 111101101; read it in groups of three for owner, group and others. The nibble box groups by four, so it does not line up with those triplets.
Privacy and limits
Every conversion runs in your browser using JavaScript BigInt, so there is no 64 bit limit and no rounding. Nothing you type is sent anywhere or saved, and the fields are empty again when you reload.
Everything a converter should do.
- Convert decimal to binary, hex or octal instantly as you type in any field.
- Convert hex to binary or decimal for low-level debugging, colour codes and protocol work.
- Read nibble-grouped binary in tidy 4-bit chunks with alternating colours for quick scanning.
- See bit length and byte length of any value at a glance in the stats bar.
- Handle negative numbers with a leading minus sign, shown in sign-magnitude form.
- Work with huge integers: BigInt means no overflow and no precision loss, ever.
Frequently asked questions.
Is the Number Base Converter free?
Is it private? Is my data uploaded anywhere?
Can it handle very large numbers?
Does it support negative numbers and fractions?
What are nibbles and why group binary that way?
Published · Last updated .