About the Number Base Converter
Numbers are represented differently depending on context — binary for low-level bit flags, octal for legacy Unix file permissions, decimal for everyday math, and hexadecimal for memory addresses, color codes, and hashes.
This tool converts a number between binary, octal, decimal, and hexadecimal simultaneously — type a value into any one field and the other three update instantly.
How it works
- Type a number into any of the four fields (binary, octal, decimal, or hex).
- The other three fields recalculate automatically to show the same value in their respective base.
- An error appears if the value you typed contains digits invalid for that base.
Common use cases
- Setting Unix file permissions: Converting an octal permission value like 755 to binary to understand exactly which read/write/execute bits are set.
- Reading memory addresses or color codes: Converting a hexadecimal value from a debugger or a CSS color into decimal to do arithmetic on it.
- Working with bit flags: Converting a decimal flag value into binary to see exactly which individual bits are enabled.
Frequently asked questions
Why does the hex field accept a 0x prefix?
A leading `0x` is a common convention for marking a value as hexadecimal in code (like in C, JavaScript, or Python); this tool strips it automatically before parsing so you can paste hex values copied directly from code.
What counts as an invalid number for a given base?
Each base only allows specific digits — binary allows 0-1, octal allows 0-7, decimal allows 0-9, and hex allows 0-9 and A-F. Typing a digit outside that range (like an '8' in an octal field) triggers the error message.
Does this tool support negative numbers?
The conversion is built around standard non-negative integer parsing; for negative values or two's-complement representations, additional context (like bit width) is needed that this simple four-field converter doesn't capture.
Can I convert very large numbers?
It uses standard JavaScript number parsing, which is reliably precise up to about 2^53; extremely large integers beyond that range may lose precision, similar to any standard calculator.
This tool runs entirely in your browser — nothing you enter is sent to a server. Read more in the Privacy Policy, or browse the full list of tools.