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

DecimalBinaryOctalHexadecimal
0000
1111
21022
31133
410044
510155
611066
711177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F
16100002010

Common values

DecimalBinaryOctalHexadecimal
321000004020
64100000010040
100110010014464
12711111111777F
1281000000020080
20011001000310C8
25511111111377FF
256100000000400100
51210000000001000200
1000111110100017503E8
1023111111111117773FF
1024100000000002000400
20481000000000004000800
40951111111111117777FFF
40961000000000000100001000
655351111111111111111177777FFFF
655361000000000000000020000010000

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.