Free calculatorLive resultsSteps and sourcesEmbed on your site, free

Base Calculator

Number Base Converter and Binary Calculator works out Result in the target base and Decimal value from Number, From base and To base. The default figures on this page give result in the target base of 10; change any entry and the result, the working and the sources update together.

Result in the target base
10
Number Base Converter and Binary Calculator
Decimal value
10
Binary
1010
Octal
12
Hexadecimal
a
Decimal value (numeric)
10
Bits needed (magnitude)
4
Two's complement pattern
00001010
One's complement pattern
00001010
Unsigned value of that pattern
10
Binary in nibbles
1010
Worked out from Donald E. Knuth, The Art of Computer Programming, Volume 2: Seminumerical Algorithms, section 4.1 (Positional Number Systems) and 2 other sources.

Your figures

Updates as you type
Digits in the "from" base. 0x, 0b and 0o prefixes, spaces and underscores are accepted; a leading minus sign is allowed.
Written in the same "from" base. For shifts this is the number of bit positions, read as a plain decimal count.
Used for the two's complement pattern and for bitwise operations.

How this is worked out

2 steps
  1. "1010" read in base 2 is 10 in decimal.
  2. 10 in base 10 is 10.

Its 5 worked examples are re-run on every release, last on 15 September 2026. What changed

Sources and references

3 sources
Donald E. Knuth, The Art of Computer Programming, Volume 2: Seminumerical Algorithms, section 4.1 (Positional Number Systems)
3rd edition, 1997 · Definition of positional notation and of radix conversion by repeated division.
IEEE Std 754 / ISO/IEC 9899 (C) section 6.2.6.2 - integer representations
Two's complement: a negative value n in an N-bit field is stored as 2^N + n.
ECMA-262, ECMAScript Language Specification - BigInt.asUintN / BigInt.asIntN
Defines the modular wrap used here for fixed-width results.

What the Number Base Converter and Binary Calculator calculates

Converts whole numbers between binary, octal, decimal, hexadecimal and any base from 2 to 36, and performs binary arithmetic and bitwise operations with two's complement fixed-width results.

How to use this Number Base Converter and Binary Calculator

Enter Number, From base, To base and Operation. Result in the target base updates as you type, and “Use a worked example” loads checked figures you can adjust. Change one figure at a time to see what drives the result.

How the result is worked out

Open “How this is worked out” beside the result for the step-by-step calculation behind Result in the target base, Decimal value and Binary.

The method follows Donald E. Knuth, The Art of Computer Programming, Volume 2: Seminumerical Algorithms, section 4.1 (Positional Number Systems), IEEE Std 754 / ISO/IEC 9899 (C) section 6.2.6.2 - integer representations and ECMA-262, ECMAScript Language Specification - BigInt.asUintN / BigInt.asIntN.

Binary 11010110 to decimal example

With Number: 11010110, From base: 2, To base: 10, the calculator returns Result in the target base: 214, Hexadecimal: d6, Octal: 326. This example is checked against an independent source in the test suite.

What you can compare

Change one input at a time to see how it affects Result in the target base, Decimal value and Binary. The inputs you can vary are Number, From base, To base, Operation, Second number (B) and Word width.

Results are general information, not financial, tax, legal, medical or engineering advice. Check any decision that matters with a qualified professional.

Embed this calculator on your website

Copy this code into any page. The calculator appears with the figures currently entered, sizes itself to fit, and a small credit line links back here. Free, no account, no ads inside it, no tracking of your readers. Set your own figures and fixed fields; Personal removes the credit line, sets your colour and shows you which sites use it.

Preview

See something wrong? Report a problem with this calculator

Frequently asked questions

How to do base on a calculator?

Converts whole numbers between binary, octal, decimal, hexadecimal and any base from 2 to 36, and performs binary arithmetic and bitwise operations with two's complement fixed-width results. Open “How this is worked out” beside the result to see each step for your own figures.

Do we use base 10 or 9?

Converts whole numbers between binary, octal, decimal, hexadecimal and any base from 2 to 36, and performs binary arithmetic and bitwise operations with two's complement fixed-width results. Put your own figures in above and the working updates beside the result. For scale, the default figures on this page give 10.

What is base 7 of 100?

Converts whole numbers between binary, octal, decimal, hexadecimal and any base from 2 to 36, and performs binary arithmetic and bitwise operations with two's complement fixed-width results. On this page it is computed from Number, From base and To base and shown as Result in the target base, Decimal value and Binary.

What is a base calculator used for?

It needs Number, From base, To base, Operation, Second number (B) and Word width. Nothing else is required, and the figures stay in your browser.

What information do I need for the Number Base Converter and Binary Calculator?

You need Number, From base, To base, Operation, Second number (B), Word width and Uppercase digits. The page opens with default figures that give result in the target base of 10, so you can see the scale before entering your own.

What does this Number Base Converter and Binary Calculator show?

It shows Result in the target base, Decimal value, Binary, Octal, Hexadecimal, Decimal value (numeric), Bits needed (magnitude) and Two's complement pattern, with the working and any warnings for your entries.

Related calculators

View all related calculators12 more