Number Base Converter
Convert numbers between binary, octal, decimal, and hexadecimal instantly in your browser, with accuracy preserved for very large values. Decode a hex color code, build a bitmask for feature flags, or work out Unix file permission notation in octal.
Usage examples
Turning a hex color code or memory address into decimal
Type a hex value you ran into while programming or debugging and instantly see it in decimal, or go the other way from decimal to hex.
Checking the raw bit pattern of a number
See exactly how a decimal or hex number is represented in binary, and which bits are set.
Understanding Unix file permission notation (octal)
Convert an octal permission value like chmod 755 to decimal or binary to see what each digit actually grants.
Decoding a CSS or design-tool color value by hand
Split a hex color like #1E90FF into its FF, 1E, and 90 channel pairs and convert each one to decimal to get the exact 0-255 RGB values a design spec or color picker is asking for.
Building or reading a bitmask for feature flags
Enter a decimal flag value, switch to binary, and see exactly which bits are set, which makes it easy to confirm a combined bitmask like 13 correctly represents flags 1, 4, and 8 all being enabled.
Translating a network subnet mask between notations
Convert a decimal octet of a subnet mask, like 255 or 248, into binary to see the run of leading 1 bits, which is the quickest way to confirm how many host bits a given mask actually leaves available.
Working with a huge number that overflows normal calculators
Paste a very large decimal or hexadecimal number — bigger than JavaScript's safe integer range — and convert it to another base to confirm the full-precision result instead of a rounded approximation.
Quick reference
0 – 16
| Decimal | Binary | Octal | Hexadecimal |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 3 | 11 | 3 | 3 |
| 4 | 100 | 4 | 4 |
| 5 | 101 | 5 | 5 |
| 6 | 110 | 6 | 6 |
| 7 | 111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 9 | 1001 | 11 | 9 |
| 10 | 1010 | 12 | A |
| 11 | 1011 | 13 | B |
| 12 | 1100 | 14 | C |
| 13 | 1101 | 15 | D |
| 14 | 1110 | 16 | E |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
Common values
| Decimal | Binary | Octal | Hexadecimal |
|---|---|---|---|
| 32 | 100000 | 40 | 20 |
| 64 | 1000000 | 100 | 40 |
| 100 | 1100100 | 144 | 64 |
| 127 | 1111111 | 177 | 7F |
| 128 | 10000000 | 200 | 80 |
| 200 | 11001000 | 310 | C8 |
| 255 | 11111111 | 377 | FF |
| 256 | 100000000 | 400 | 100 |
| 512 | 1000000000 | 1000 | 200 |
| 1000 | 1111101000 | 1750 | 3E8 |
| 1023 | 1111111111 | 1777 | 3FF |
| 1024 | 10000000000 | 2000 | 400 |
| 2048 | 100000000000 | 4000 | 800 |
| 4095 | 111111111111 | 7777 | FFF |
| 4096 | 1000000000000 | 10000 | 1000 |
| 65535 | 1111111111111111 | 177777 | FFFF |
| 65536 | 10000000000000000 | 200000 | 10000 |
Frequently asked questions
Is the value I enter sent to a server?
No. All conversions happen entirely in your browser, and the value you enter is never sent to a server.
Does it stay accurate for very large numbers?
Yes. Unlike ordinary floating-point math, the conversion uses a lossless arbitrary-precision representation, so even very large numbers convert exactly.
Can I enter negative numbers?
No. Negative numbers are represented differently across bases (such as two's complement), which would be confusing, so only non-negative integers are supported.
Can I convert decimal values with a fractional part?
No. Only whole numbers are supported — you can't enter a decimal point.
Which number bases are supported?
Binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). Each field updates the others live as you type, so you can edit whichever base is most convenient and read the rest off instantly.
Why don't regular JavaScript numbers handle large values precisely?
JavaScript's standard Number type is a 64-bit float, which can only represent integers exactly up to 2^53 - 1 (about 9 quadrillion). Beyond that, some integer values can't be represented exactly and calculations silently lose precision. This tool avoids that entirely by using BigInt internally, which represents integers of any size exactly, so there's no upper limit on how large a number you can safely convert.
Why does hexadecimal show letters as well as digits?
Hex is base 16, so it needs 16 distinct symbols per digit. The digits 0-9 cover the first ten values, and the letters A-F (or a-f) represent values 10 through 15, so a single hex digit can express any value from 0 to 15.
What's a common real-world use for octal numbers?
The most common case developers run into is Unix/Linux file permissions, where a value like 644 or 755 is interpreted one octal digit at a time — each digit is three bits representing read, write, and execute permissions for the owner, group, and others respectively.
If I type an invalid digit for the selected base, what happens?
The field is validated against the character set allowed for that base — for example, typing an 8 or 9 while in binary mode, or a letter while in decimal mode, is flagged as invalid rather than silently accepted or truncated, so you know immediately that the value doesn't belong in that base.