TapCub is live — analytics, insights and live chat, free on one platform

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.

Converter
Quick conversions
8 bits, 1 byte(s) · fits unsigned 8-bit; signed needs more bits

Step by step

Divide the whole part by 2 again and again, keeping each remainder

NumberQuotient ÷ 2RemainderDigit
20210100
1015011
502500
251211
12600
6300
3111
1011

Read the digits from the bottom up: 110010102

Runs entirely in your browser. Nothing you type here is uploaded or stored by TapCub.

Share these inputs: the values go after the # in the link, so they never reach a server.

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

Read the result

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
Number base converter illustration: Convert between binary, octal, decimal, hex and any base from 2 to 36, with fractions, huge integers, two’s complement, text to binary and steps
Number base converter, illustrated

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.

How to use it

Three modes for three jobs

Pick the mode that matches what you have.

  1. 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. 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. 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.

Method

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
0 to 15 in four bases
DecimalBinaryOctalHex
0000000
1000111
2001022
3001133
4010044
5010155
6011066
7011177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F
Worked example

Hex 1A3F to decimal, and 214 to binary

Both directions, written out as you would on paper.

Two conversions by hand
StepWorkingResult
1A3F → place values1×16³ + 10×16² + 3×16 + 15×14096 + 2560 + 48 + 15 = 6719
214 ÷ 2, repeatedlyremainders 0, 1, 1, 0, 1, 0, 1, 1read upwards: 11010110
11010110 → hexgroup as 1101 0110D6
11010110 as signed 8-bit214 − 256−42
0.1 → binarymultiply by 2 until a remainder repeats0.0(0011): the block 0011 repeats without end
−42 as sign-magnitude / one’s / two’s complementsign bit plus magnitude; invert; add 110101010 / 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.

Common mistakes

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.

FAQ

Base 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.

Feedback

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.

Rate this tool

Please don’t include passwords or other sensitive information.

Only used to reply to this feedback.

Type, details and email are required.

We only use this to handle your feedback. See the privacy policy.

Feedback received

Thank you! We will read it and reply from hello@tapcub.com if needed.

Need help right now?

Chat with our support team, best for urgent problems; you can leave a message when we are offline.

Chat with support
Changelog

Update history

New features, fixes and data refreshes for this tool, newest first.

  1. · 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

Cite this tool

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.

URL
https://tapcub.com/tools/number-base-converter
HTML link
<a href="https://tapcub.com/tools/number-base-converter">Number base converter - TapCub</a>

See your data clearly. Find your growth.

Every click, backed by data. Install one line of code and see your first numbers in a minute.

No credit card · Free plans for analytics and chat · Cookieless analytics