Number Base Converter
Type a number and choose its base — the binary, octal, decimal and hexadecimal versions all update instantly.
Reviewed by the ToolNestr Editorial Team — July 2026
How number base conversion works
Number base conversion relies on positional notation — each digit's value depends on its position and the base of the number system. The decimal number 2026 means 2×10³ + 0×10² + 2×10¹ + 6×10⁰.
To convert between bases, the tool first converts your input to a decimal integer using parseInt(value, base), then formats that integer into the target base using number.toString(base). Each output shows the same numeric value written in a different numeral system.
Worked example
Converting the decimal number 2026 into binary, hex, and octal.
About number bases
Computers work in binary, but programmers regularly switch between binary, octal, decimal and hexadecimal. This converter lets you type a value in any of those bases and instantly see it in all the others — handy for debugging, working with colors, bit masks or memory addresses. Pair it with the Color Converter to understand hex colour codes, or the Timestamp Converter to work with epoch time values.
How to use it
- Select the base of the number you're entering.
- Type the value.
- Read the equivalents and copy any one you need.
When to use this tool
Converting between number bases is a fundamental skill in programming and computer science. Developers use it when debugging memory addresses in hex, interpreting permission bits in octal for Linux file systems, or working with colour values in CSS. Students learning computer architecture convert between binary and hex to understand how data flows through a CPU. Network engineers calculate subnet masks in binary. Embedded systems programmers read register values directly in hex from datasheets and need quick conversions to decimal.
What different number bases mean
Each base has its own strengths and typical use cases. Here is how they compare in practical programming scenarios.
Software Engineer
Converts hex memory addresses during debugging, interprets bit masks in embedded C, and works with colour values in front-end development.
Network Engineer
Calculates subnet masks and IP ranges using binary and decimal conversions for network configuration and troubleshooting.
Computer Science Student
Practises base conversions while studying computer architecture, digital logic, and low-level programming concepts.
Embedded Systems Developer
Reads hardware register values from datasheets in hex and converts them to decimal for configuration and interrupt handling.
| Base | Digits | Common Use |
|---|---|---|
| Binary (2) | 0, 1 | Bitwise operations, flags, hardware registers |
| Octal (8) | 0–7 | Unix file permissions (755, 644), chmod |
| Decimal (10) | 0–9 | Everyday counting, user-facing numbers |
| Hexadecimal (16) | 0–9, A–F | Colours (#FF5733), memory addresses, byte values |
How to use the number base converter
Choose input base
Select the base your number is currently in — binary, octal, decimal, or hexadecimal.
Type your number
Enter a valid value for the selected base. All four output fields update automatically as you type.
Copy the result
Use the Copy button next to any output field to grab the converted value in your desired base.
Tips for working with number bases
Know your prefixes
In code: 0b for binary, 0o for octal, 0x for hex. The converter strips 0x automatically, but most languages use these prefixes to distinguish number bases.
Think in groups for mental conversion
Each hex digit represents 4 binary bits. Group binary digits into sets of 4 to mentally convert between binary and hex. For octal, group into 3-bit sets.
Validate your input first
If you see a red error message, check that your input only contains digits valid for the selected base — binary allows only 0 and 1, hex allows 0–9 and A–F.
Frequently asked questions
Which bases are supported?
Binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16) — the four most common in computing.
What is hexadecimal used for?
Hex is widely used in programming for colors (#ff0000), memory addresses and byte values, because each hex digit maps neatly to 4 binary bits.
Why is my input invalid?
Each base only allows certain digits — binary uses 0–1, octal 0–7, decimal 0–9, and hex 0–9 plus A–F. Check your input matches the chosen base.
Is it private?
Yes, everything runs in your browser.
What is binary used for?
Binary is the native language of computers. Programmers use it for bitwise operations, flags in permission systems, and understanding how data is stored at the hardware level.
Can I convert values with decimal points?
This converter handles whole numbers only. For fractional values you’ll need a specialised floating-point converter.
What does "0x" mean in hex?
In many programming languages, 0x is a prefix that indicates a hexadecimal number. For example, 0xFF is the same as 255 in decimal. The tool strips the prefix automatically.
What is the largest number I can convert?
JavaScript can safely represent integers up to 2^53 – 1 (about 9 quadrillion). Numbers beyond this may lose precision in conversion.
Why does octal matter for file permissions?
Unix/Linux file permissions use octal notation (e.g., 755) because each digit maps directly to three permission bits (read, write, execute) for user, group, and others.
Can I convert negative numbers?
This converter handles positive integers only. Negative numbers typically use two's complement representation, which is not supported here.