Quick Work Studio logo Quick Work Studio

Converters

Number Base Converter

Binary, octal, decimal, hex.

About the Number Base Converter

The Number Base Converter shows any whole number in decimal, binary, octal and hexadecimal at once, plus any other base from 2 to 36. Choose the base you typed in, or use Auto to read 0x, 0b and 0o prefixes. It handles numbers of any size exactly, shows the bits and byte count, and copies any result with a tap.

What you can do with the Number Base Converter

How number bases work

In decimal, each position is worth ten times the one to its right. In binary, each position is worth twice as much, so only 0 and 1 are used. Hexadecimal needs sixteen digits, so after 9 it uses A to F for 10 to 15. Bases up to 36 use all the letters of the alphabet.

Where you'll meet them

Hexadecimal maps neatly onto binary, one hex digit is exactly four bits, so it's used for colour codes like #FF8800 and memory addresses. Octal appears in Unix file permissions, such as chmod 755. Base 36 is used for short IDs and URL shorteners because it packs a lot into few characters.

Any size, exactly

Ordinary calculators lose precision above 9,007,199,254,740,991. This tool uses big-integer arithmetic, so even 30-digit numbers convert exactly. Negative numbers keep their minus sign.

Related tools

Frequently Asked Questions

What is 255 in hexadecimal and binary?

FF in hexadecimal and 11111111 in binary, the largest value a single byte can hold.

What do 0x, 0b and 0o mean?

They're prefixes programmers use for hex, binary and octal. Choose Auto and the tool reads them for you.

How do I convert text to binary instead of a number?

Use the Binary Translator, which converts each character of your text.

How do I convert decimal to binary by hand?

Divide the number by 2 repeatedly and write down each remainder, then read the remainders from bottom to top. For 13: 13/2 = 6 r1, 6/2 = 3 r0, 3/2 = 1 r1, 1/2 = 0 r1, so 13 is 1101 in binary.

How do I convert hex to decimal by hand?

Multiply each digit by a power of 16, counting from the right, and add them up, with A to F meaning 10 to 15. For 1A3: 1 x 256 + 10 x 16 + 3 x 1 = 419.

Why does hexadecimal use letters?

Base 16 needs sixteen digits, so after 0 to 9 it uses A to F for 10 to 15. Higher bases continue the alphabet: base 36 uses 0 to 9 and A to Z, which is why it is popular for short codes and IDs.

Can it convert negative numbers?

Yes, type a minus sign and the result keeps the minus sign in every base, such as -255 to -FF. It does not show the two's complement form that computers use internally, and the bits panel shows the number without its sign.

Can I convert decimal fractions like 12.5?

No, it converts whole numbers only. A decimal point is not a valid digit, so 12.5 shows an error. To convert a fraction you would need to handle the part after the point separately, by repeatedly multiplying it by the target base.

Why do I get an error saying a digit isn't valid?

The number contains a digit that does not exist in the chosen base, such as a 2 in binary, an 8 in octal or a G in hex. Check that the It is written in option matches your number, or choose Auto if it has a 0x, 0b or 0o prefix.

Can I paste numbers with spaces, commas or underscores?

Yes. Spaces, commas and underscores are ignored, so 1111 1111, 1111_1111 and 1,000,000 are all read correctly. This makes it easy to paste grouped binary or numbers copied from code.

How many bytes does a number need?

Count its binary digits and divide by 8, rounding up. 255 is 11111111, which is 8 bits or 1 byte, while 256 needs 9 bits and so 2 bytes. The bits panel shows the bit count, byte count and how many bits are set.

Related tools

One studio. 96 tools.
Zero installs.

Browse by category
All tools
Guides & articles
CalculatorsHow Much Electricity Do Your AC, Geyser and Fans Really Use?Turn the watts on an appliance label into units and rupees, see which appliances actually drive your bill, and find the easy savings. CalculatorsWhich Pack Is Really Cheaper? How to Compare Unit PricesBigger packs aren't always better value. A simple way to compare price per kg, per litre or per piece, plus the shopping traps to watch for. CalculatorsHow to Calculate Your Exact Age "As On" a Date for Exam FormsRecruitment notices ask for your age as on a cut-off date. Here's how to count it correctly in years, months and days, and the cases that trip people up. Text ToolsHow Many Words Is That? Word and Character Limits ExplainedHow many words fit on a page, how long a speech takes, and the character limits for posts, meta descriptions and SMS, with tips for cutting to fit. CalculatorsSIP vs Lumpsum: Which Builds More Wealth?How monthly SIPs and one-time lumpsum investing really compare, when each one wins, and why most people should not agonise over the choice. CalculatorsUnderstanding Your Salary: CTC, Gross and In-HandWhy your offer letter number is bigger than what lands in your account, what CTC really includes, and how to compare job offers fairly.

All articles →

Every tool on Quick Work Studio, free and in your browser. Prefer reading first? See the guides or full directory.