This tool runs in your browser using JavaScript. If it does not appear, please enable JavaScript or reload the page. The description below explains how it works.
Number Base Converter
Computers store numbers as binary - zeros and ones - but people usually work in decimal, and developers constantly jump between binary, octal, decimal, and hexadecimal. This tool converts the same integer into all four bases at once. Type into any field and the other three update immediately, so you never have to think about which one is the "source".
How to use
- Type into any of the four fields. The tool treats the field you are editing as the source and updates the other three. The active field is highlighted blue so you can always see which representation you started from.
- Keep typing - conversion happens with every keystroke, there is no button to press.
- Uppercase hex - toggles whether letters A–F in the hexadecimal field are shown in capitals (
FFinstead offf). Applied automatically to the hex column whenever the tool rewrites it; digits typed by you are always accepted in either case. - Copy - each row has its own copy button, so you can grab exactly the representation you need (for example only the binary form) without touching the others.
- Clear - resets all four fields and puts the cursor back on the decimal row.
What it does
The same integer is written in four notations:
- Binary (base 2) - digits
0and1. The natural form inside a CPU, used for bit masks, IPv4 addresses for network engineers, and flag bitfields such as Unix file permissions before they are packed. - Octal (base 8) - digits
0to7. Classic Unix file permissions (755,644) and some legacy encodings read in octal. Rare today, but still worth having at hand. - Decimal (base 10) - digits
0to9. The natural human notation and the one used for most everyday numbers. - Hexadecimal (base 16) - digits
0to9plusAtoF. The compact way to write bytes: two hex digits are exactly one byte. Used for colors (#0f0f0f), memory addresses, hash digests, and binary inspection tools such ashexdump.
Notes and examples
255in decimal is11111111in binary,377in octal, andffin hexadecimal. Try typing255, then11111111, thenff- you end at the same number each time.128in decimal is10000000in binary (a single bit set - handy when reasoning about powers of two) and80in hexadecimal.- Negative numbers work:
-8in decimal is-1000in binary,-10in octal, and-8in hexadecimal. The minus sign is kept outside each representation. - The converter is built on JavaScript
BigInt, so it handles values far beyond the 53-bit safe-integer range of ordinaryparseInt-based converters without silently rounding. A 30-digit decimal number converts exactly. - Only whole numbers are supported. Fractions like
3.14or1/3are not accepted; feed in the integer part only. If you need fractional binary/hex work, that belongs in a different tool than this site currently offers. - No prefixes. Type raw digits only -
0x,0b, trailingh, or#are not recognized. Paste the digits and leave the prefix behind (the tool would otherwise reject thex,b, or#characters with a clear per-character error). - Leading zeros are not preserved. When you type
001in decimal, the other fields show1. The field you are typing into keeps exactly what you typed; the others show the canonical, shortest form. - Invalid digits produce a specific error that names the offending character and the allowed range, for example
"9" is not a valid Binary digit (0–1). Inputs longer than 4,096 digits are rejected to keep the page responsive.
When to use this over other tools on the site
If you mostly move between text encodings, the Base64 tool is about converting text, not numbers. This converter is deliberately numeric. If you are translating a whole set of numbers at once rather than one value, work through them one at a time - there is no batch mode.