AnyTool
Your files never leave your device. All processing happens locally in your browser.

How do I convert a number between binary, octal, decimal and hexadecimal?

Type a value into AnyTool Number Base Converter and pick its input base. It instantly shows the number in binary, octal, decimal and hexadecimal at once, plus an arbitrary from→to selector for any base from 2 to 36. Every conversion uses BigInt, so 64-bit and longer values stay exact, and it adds two’s-complement bit patterns, binary grouping and 0x/0b/0o prefixes. Everything is calculated in your browser, so nothing is uploaded.

  • Binary, octal, decimal and hex shown at once, each copyable
  • Convert between any base 2-36 with a from→to selector
  • Exact BigInt arithmetic — 64-bit+ values never round
  • Two’s-complement view for 8/16/32/64-bit, plus binary grouping and 0x/0b/0o prefixes
  • 100% in your browser — no upload, no signup, works offline

What is

Number Base Conversion

Number base (radix) conversion rewrites an integer in a different positional notation — for example decimal 214 as binary 11010110, octal 326 or hexadecimal D6. The value is unchanged; only the digit symbols and the base of the place values differ, where each digit is multiplied by the base raised to its position.

Converters

Related terms

Binary to decimalHexadecimalOctalTwo’s complementRadix

Frequently Asked Questions

Repeatedly divide the number by 2 and read the remainders bottom to top. Decimal 214 is 11010110 in binary.

To convert a decimal number to binary, divide it by 2 over and over, writing down each remainder, then read the remainders from last to first. For example 214 ÷ 2 gives remainders 0,1,1,0,1,0,1,1, so 214 is 11010110 in binary. AnyTool does this instantly and also shows the octal and hexadecimal forms at the same time.

Multiply each hex digit by 16 raised to its position and add them up. 0xD6 is 13×16 + 6 = 214.

Each hexadecimal digit has a place value that is a power of 16. Multiply the digit by 16 to the power of its position (counting from 0 on the right) and sum the results. For 0xD6, that is 13×16¹ + 6×16⁰ = 208 + 6 = 214. AnyTool shows this place-value breakdown digit by digit beneath the converter.

Yes. It uses BigInt, so 64-bit and larger values convert exactly, unlike tools that round above 2^53.

AnyTool Number Base Converter parses every value into a single BigInt and formats it from there, so even a full 64-bit value such as 0xFFFFFFFFFFFFFFFF converts with no rounding. Plain JavaScript numbers lose precision above 2^53, which is why many online converters get large hex and binary values wrong.

It shows how a number is stored as a signed 8/16/32/64-bit value, including negatives as their bit pattern.

Two’s complement is how computers store signed integers. Pick an 8, 16, 32 or 64-bit width and AnyTool shows the binary, hex and unsigned-decimal bit pattern for that width, wrapping a negative value into value + 2^bits. It also lists the signed and unsigned range so you can see whether a value fits — useful for embedded and low-level programming.

Detailed Explanation

Methodology

How the Number Base Converter Works

AnyTool Number Base Converter performs every conversion in the browser using a "value-to-base-to-value" model. The input string is parsed in its chosen base into a single canonical BigInt — accumulating digit × base + nextDigit — and that BigInt is then formatted into binary, octal, decimal, hexadecimal and any selected radix from 2 to 36. Because BigInt is arbitrary-precision, a full 64-bit value such as 0xFFFFFFFFFFFFFFFF converts exactly, whereas tools built on ordinary JavaScript numbers lose precision above 2^53. A leading minus sign denotes a negative integer, and 0x / 0b / 0o prefixes, spaces and underscores are accepted on input.

  • Any radix from 2 to 36, with binary/octal/decimal/hex shown at once
  • All arithmetic is BigInt — 64-bit and longer values never round
  • Input is parsed to one canonical integer, then formatted to every base
  • Accepts signs, 0x/0b/0o prefixes and digit-group separators
  • Editing the value or the input base reconverts live
How It Works

Two’s Complement, Grouping and Place Value

Beyond plain conversion, the tool offers a two’s-complement view for 8, 16, 32 and 64-bit widths: it shows the unsigned binary, hex and decimal bit pattern for the chosen width, wrapping negative values into value + 2^bits, and lists the signed and unsigned range so you can see whether a value fits. Binary output can be grouped into 4-bit nibbles or 8-bit bytes, hexadecimal can be uppercased, and 0x/0b/0o prefixes can be toggled on. A per-digit place-value expansion shows how the input adds up — for example D6₁₆ = 13×16¹ + 6×16⁰ = 214 — making it useful for teaching as well as programming.

  • Two’s-complement bit patterns for 8/16/32/64-bit widths
  • Signed and unsigned range shown, with out-of-range warnings
  • Binary grouping into nibbles or bytes
  • Uppercase hex and optional 0x/0b/0o prefixes
  • Per-digit place-value breakdown for education
Privacy & Security

Privacy and Offline Use

Because all parsing and formatting run in the browser through a pure, unit-tested engine, no value is sent to a server, there is no account or tracking, and the page works offline after first load. The same engine powers each base card and the arbitrary-radix selector, so results are consistent everywhere on the page.

Number base conversion: in-browser (AnyTool) vs typical online converters
CapabilityAnyToolTypical online converters
ProcessingRuns in your browserOften server-side
BasesAny radix 2-36, plus bin/oct/dec/hex at onceOften fixed bin/oct/dec/hex
Large numbersExact via BigInt (64-bit+)Frequently round above 2^53
Two’s complement8/16/32/64-bit, signed + unsigned rangesRarely offered
FormattingGrouping, uppercase hex, 0x/0b/0o prefixesUsually plain output
EducationPer-digit place-value breakdownSeldom shown
Works offlineYes (PWA)No
Cost / signupFree, no signupOften ad-heavy or gated

AnyTool converts every base locally with exact BigInt arithmetic and uploads nothing.