How to Convert Between Number Bases
Programmers move between bases constantly — a colour is hex, a permission mask is octal, a flag field is binary, and the value in the debugger is decimal. Doing that arithmetic by hand is slow and error-prone. Pick the base your number is written in, type it, and every other representation appears at once: binary, octal, decimal, hexadecimal, plus any custom base from 2 to 36. Conversion uses arbitrary-precision arithmetic, so values far beyond the usual 64-bit ceiling convert exactly rather than silently losing their least significant digits the way floating-point tools do. The grouped bit view is the part that saves real time when you're working with flags or masks: binary shown in four-bit groups at 8, 16, 32 or 64-bit width, so you can read bit positions at a glance instead of counting characters, with a warning when your value needs more bits than the selected width. Alongside it, a readout shows exactly how many bits and bytes the number requires. Negative values are supported, spaces and underscores in your input are ignored, and invalid digits produce a clear message listing exactly which characters that base allows.
Pick the input base
Tell the tool whether your number is binary, octal, decimal or hex.
Type the number
Every other base converts instantly, along with the bit view.
Copy what you need
Each representation has its own copy button.
Why Bases Matter
Binary and hexadecimal
Computers work in binary, but long strings of ones and zeros are unreadable. Hexadecimal is the compact shorthand: each hex digit maps to exactly four bits, so FF is 11111111 and conversion is mechanical.
Octal and the rest
Octal groups bits in threes, which is why Unix file permissions use it — 755 maps neatly onto nine permission bits. Higher bases like 36 pack numbers into shorter strings for IDs and short links.
Common Use Cases
Debug bit flags
See exactly which bits are set in a flag or mask value.
Unix permissions
Convert an octal mode like 755 into its binary permission bits.
Colour values
Turn a hex colour component into decimal, or the reverse.
Memory addresses
Read hexadecimal addresses as decimal offsets.
Network masks
Understand subnet masks by viewing them in binary.
Short ID encoding
Compress a large number into base 36 for compact identifiers.
Embedded work
Convert register values between hex and binary quickly.
Learning & teaching
Show how the same number looks across bases with the bit view.
Tips & Best Practices
One hex digit is four bits
That mapping makes hex-to-binary conversion mechanical — F is 1111 every time.
Group your bits
Reading binary in four-bit groups is far easier than one long run of digits.
Watch the bit width
If your value needs more bits than the selected width, the view truncates — switch to a wider setting.
Drop the prefix
Enter FF rather than 0xFF; prefixes like 0x and 0b belong to source code, not the value itself.
Mind signed representations
This tool shows a sign and magnitude. Two's-complement encoding is a separate concept for fixed-width types.
Use base 36 for short IDs
Digits plus letters pack a large number into far fewer characters than decimal.
Troubleshooting
It says my number is invalid
The digits must be valid for the chosen base. Binary allows only 0 and 1; octal only 0 to 7. The allowed set is listed under the input.
My 0x prefix is rejected
Enter just the digits. Select Hexadecimal as the base and type FF rather than 0xFF.
The bit view is cut off
Your number needs more bits than the selected width. Choose a wider view such as 32 or 64-bit.
A huge number lost digits elsewhere
Not here — this tool uses arbitrary-precision arithmetic. Other tools using floating point lose precision beyond about 15 digits.
Frequently Asked Questions
How do I convert a number base for free?
Pick your input base, type the number, and binary, octal, decimal, hex and a custom base all appear instantly — free, no signup.
Which bases are supported?
Binary, octal, decimal and hexadecimal as one-tap options, plus any custom base from 2 to 36.
Can it handle very large numbers?
Yes. Conversion uses arbitrary-precision arithmetic, so numbers far beyond 64 bits convert exactly.
Are negative numbers supported?
Yes. Prefix the value with a minus sign and it converts correctly in every base.
What is the bit view?
The binary value shown in four-bit groups at your chosen width, which makes reading bit positions much easier.
Why is my bit view truncated?
The number needs more bits than the selected width. Switch to a wider view such as 32 or 64-bit.
Should I include the 0x prefix?
No. Choose Hexadecimal as the base and enter just the digits, such as FF.
Can I use spaces in the input?
Yes. Spaces, commas and underscores are ignored, so grouped input like 1111 0000 works.
What does bits needed mean?
The minimum number of binary digits required to represent your value, and the bytes that implies.
Why is hex used so much in computing?
Each hex digit maps to exactly four bits, making it a compact and lossless shorthand for binary.
Why do Unix permissions use octal?
Octal groups bits in threes, matching the read, write and execute triplets in a permission mode.
Is base 36 useful?
Yes. Using digits plus letters packs a big number into a short string, handy for compact IDs.
Does it show two's complement?
It shows sign and magnitude. Two's-complement encoding depends on a fixed word size and is a separate representation.
Is anything sent to a server?
No. All conversion happens in your browser.
Can I copy a single base?
Yes. Every row has its own copy button.
Does it support fractions?
It converts whole numbers. Fractional base conversion is a different problem with its own rounding rules.
Does it work on phones?
Yes, in any modern browser on Windows, Mac, Android or iPhone with nothing to install.
Is this tool really free?
Completely free, forever — no account, no ads and no premium wall.
100% free · No signup · Processed in your browser · Data never sent
Last updated: August 2026 · FlipMyFormat Number Base Converter
Written and maintained by the FlipMyFormat team · Runs entirely in your browser