Free tool Number base converter with step-by-step working
Type in any box and the others follow: binary, octal, decimal, hexadecimal and one custom base up to 36. Integers of any realistic size stay exact, fractions show repeating digits, and two more modes cover two’s complement and text to binary.
- Bases 2 to 36
- Exact big integers
- Converted locally
Convert a number
Start with a quick conversion or type into whichever base you have.
Saved to My tools
Open the free tools page next time and it is right at the top under My tools (stored in this browser only).
You can also press Ctrl+D to bookmark this page in your browser.You can also press ⌘+D to bookmark this page in your browser.You can also tap your browser’s Share button (at the bottom in Safari) and choose Add Bookmark or Add to Home Screen.You can also open the ⋮ menu at the top right and tap ☆ to bookmark it, or choose Add to Home screen.You can also tap ··· at the top right and choose Favorite, or open it in your browser and bookmark it there.
View My tools11001010312202CA5MStep by step
Divide the whole part by 2 again and again, keeping each remainder
| Number | Quotient ÷ 2 | Remainder | Digit |
|---|---|---|---|
| 202 | 101 | 0 | 0 |
| 101 | 50 | 1 | 1 |
| 50 | 25 | 0 | 0 |
| 25 | 12 | 1 | 1 |
| 12 | 6 | 0 | 0 |
| 6 | 3 | 0 | 0 |
| 3 | 1 | 1 | 1 |
| 1 | 0 | 1 | 1 |
Read the digits from the bottom up: 110010102
11010110Type a signed number (-42, 0xFF) or a bit pattern in binary or hex. Each box updates the other.
| Sign-magnitude | 1010 1010 |
|---|---|
| One’s complement | 1101 0101 |
| Two’s complement | 1101 0110 |
| Hexadecimal | 0xD6 |
| Read as unsigned | 214 |
| Read as signed | -42 |
- 1.Write 42 in 8 bits
0010 1010 - 2.Invert every bit
1101 0101 - 3.Add 1
1101 0110
Hi01001000 01101001Share these inputs: the values go after the # in the link, so they never reach a server.
https://tapcub.com/tools/number-base-converter
Done here? Try these next
Use this tool often? Save it to My tools.Saved to My tools. Find it any time at the top of the free tools page. You can also press Ctrl+D to bookmark this page in your browser.You can also press ⌘+D to bookmark this page in your browser.You can also tap your browser’s Share button (at the bottom in Safari) and choose Add Bookmark or Add to Home Screen.You can also open the ⋮ menu at the top right and tap ☆ to bookmark it, or choose Add to Home screen.You can also tap ··· at the top right and choose Favorite, or open it in your browser and bookmark it there.
Problem or suggestion?Send feedbackChat with support
Version v1.0Updated Update history
Same value, different notation
A base is the number of different digits. The value does not change when you switch base; only the way it is written does.
- Bases 2–36, no size rounding
- Two’s complement and text codes
- Step-by-step working

Binary, base 2
Digits 0 and 1. This is how hardware stores everything. Four binary digits make one hexadecimal digit.
Octal, base 8
Digits 0–7, three bits each. You meet it mostly in Unix file permissions such as 755.
Hexadecimal, base 16
Digits 0–9 and A–F. Compact for bytes, colours, memory addresses and hashes. Often written with a 0x prefix.
Bit length and range
The note under the boxes shows how many bits the value needs and which fixed-size integer type can hold it.
Arithmetic done in ordinary floating point silently rounds integers above 253 (9,007,199,254,740,992). This converter uses arbitrary-precision integers, so a 30-digit number converts exactly and back.
Three modes for three jobs
Pick the mode that matches what you have.
-
1
Numbers
Type into the box for the base you have. Other bases fill in at once, and the steps section shows how to get to any target base by hand.
-
2
Two’s complement
Choose 8 to 128 bits and enter a signed value to get its bit pattern, or enter a pattern to see the signed and unsigned readings.
-
3
Text ↔ codes
Turn text into UTF-8 bytes or Unicode code points in binary, octal, decimal or hex, and paste codes back to read the text.
How base conversion works
Every positional number system uses the same two ideas: place values to read a number, repeated division and multiplication to write it.
- Read a base-b number: add each digit × b^position, with positions counting from 0 at the right (negative after the point)
- Write the whole part in base b: divide by b repeatedly and read the remainders from last to first
- Write the fraction in base b: multiply by b repeatedly and take each whole part
- Binary ↔ octal and hex: group bits in threes or fours
- Two’s complement of a negative number: invert the bits of its absolute value, then add 1
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 1 | 0001 | 1 | 1 |
| 2 | 0010 | 2 | 2 |
| 3 | 0011 | 3 | 3 |
| 4 | 0100 | 4 | 4 |
| 5 | 0101 | 5 | 5 |
| 6 | 0110 | 6 | 6 |
| 7 | 0111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 9 | 1001 | 11 | 9 |
| 10 | 1010 | 12 | A |
| 11 | 1011 | 13 | B |
| 12 | 1100 | 14 | C |
| 13 | 1101 | 15 | D |
| 14 | 1110 | 16 | E |
| 15 | 1111 | 17 | F |
Hex 1A3F to decimal, and 214 to binary
Both directions, written out as you would on paper.
| Step | Working | Result |
|---|---|---|
| 1A3F → place values | 1×16³ + 10×16² + 3×16 + 15×1 | 4096 + 2560 + 48 + 15 = 6719 |
| 214 ÷ 2, repeatedly | remainders 0, 1, 1, 0, 1, 0, 1, 1 | read upwards: 11010110 |
| 11010110 → hex | group as 1101 0110 | D6 |
| 11010110 as signed 8-bit | 214 − 256 | −42 |
| 0.1 → binary | multiply by 2 until a remainder repeats | 0.0(0011): the block 0011 repeats without end |
| −42 as sign-magnitude / one’s / two’s complement | sign bit plus magnitude; invert; add 1 | 10101010 / 11010101 / 11010110 |
Two rows explain classic surprises. The same eight bits mean 214 or −42 depending on whether the type is signed. And 0.1 has no finite binary form, which is why floating-point sums such as 0.1 + 0.2 are not exactly 0.3.
Where conversions go wrong
The arithmetic is simple; the assumptions around it cause the bugs.
Forgetting the base
“10” is two in binary, eight in octal and sixteen in hex. Write a 0b, 0o or 0x prefix when the base is not obvious.
Reading a leading zero as decimal
In several languages a leading 0 means octal: 010 is eight. File permissions rely on this.
Mixing signed and unsigned
FF is 255 as an unsigned byte and −1 as a signed byte. Check the type before comparing values.
One character is not always one byte
In UTF-8, English letters take one byte, most Chinese characters three and emoji four.
Event values that keep their meaning
When your product sends events to TapCub, properties arrive with the values you give them and can be broken down in reports.
Server API events
Payments, refunds and other backend jobs send named events with a Server Key, into the same project as the website.
Learn moreCustom events and properties
Track the actions that matter, with the properties you need to break them down.
Learn moreRealtime visitors
See who is on the site right now: page, source, country and time on page.
Learn moreBase conversion questions
Still have a question?
Chat with the team behind TapCub — we usually reply within a few hours on business days.
How do I convert hex to decimal?
Multiply each hex digit by 16 raised to its position, counting from 0 on the right, then add. A–F stand for 10–15. For 1A3F: 1×4096 + 10×256 + 3×16 + 15 = 6719. The “Hex to decimal” button shows these steps for any value.
How do I convert binary to decimal?
Add the powers of two where the bit is 1. 11010110 is 128 + 64 + 16 + 4 + 2 = 214. If the number is a signed 8-bit value, the top bit counts as −128 instead, giving −42.
How do I convert decimal to binary?
Divide by 2 repeatedly and write down each remainder, then read the remainders from the last one to the first. 214 gives 11010110.
What is two’s complement?
The way almost all computers store negative integers. To negate a number, invert its bits and add 1. With n bits the range is −2n−1 to 2n−1 − 1, so a signed byte runs from −128 to 127.
How do I turn text into binary?
Each character is first encoded into bytes, normally with UTF-8, then each byte is written as 8 bits. “Hi” becomes 01001000 01101001. Switch to “Text ↔ codes” and paste in either direction.
Can it handle fractions and negative numbers?
Yes. Use a decimal point and a leading minus sign. Fractions that never end in the target base are shown with the repeating part in brackets, up to the number of digits you choose.
Is my input uploaded?
No. Conversion happens in your browser. The number and base settings are stored after the # in the address bar so a link reproduces them; text you convert in text mode is not put in the link.
Is this tool working for you?
Rate it, or tell us what went wrong and what you’d like improved. A person reads every message, and frequent requests go into the next update.
Need help right now?
Chat with our support team, best for urgent problems; you can leave a message when we are offline.
Chat with supportUpdate history
New features, fixes and data refreshes for this tool, newest first.
-
· v1.0
LaunchedFirst release.
Missing something or found an error? Tell us — requests that come up often go into the next update. All tool updates
Recommend this tool in an article or on your site
This tool is free to cite and share. Copy the URL or link below into your article, tutorial or resource page; to write a review, embed a tool or partner with us, get in touch.
https://tapcub.com/tools/number-base-converter<a href="https://tapcub.com/tools/number-base-converter">Number base converter - TapCub</a>Related developer tools
Bases show up in permissions, network masks and encodings.