Conversion calculator

Numeral Base Converter

Hex is not another system. It is the same bits, grouped four at a time.

Calculator

Spaces and underscores are ignored, so 1111_1011 is fine.

Everyday counting. Not a power of two, so it does not group cleanly against the others.

Try:

The same value in every base

bin11111111
oct377
dec255
hexff
b327v
b3673

Why hex is just the bits, regrouped

Four bits is exactly one hex digit, so converting between them moves no arithmetic at all — it only changes where you draw the lines.

Bits, in fours
1111 1111
The same, as hex
f f

What this converter covers

Binary, octal, decimal and hex at once — with the bit grouping shown, and negatives handled at a width you choose rather than guessed at.

  • Binary, octal, decimal, hex, base 32 and base 36
  • The 4-bit grouping that maps binary onto hex, shown rather than asserted
  • Two’s complement at 8, 16, 32 or 64 bits for negative values
  • A refusal, not a wrap, when a value will not fit the width you chose
  • Arbitrary-precision integers, so a 20-digit hex constant keeps every digit
Bit grouping shown Exact past 2⁵³ Six bases at once Both directions

Free, no signup — exact by definition, not an estimate.

Updated 7 September 2026

At a glance

Formula shown
Repeated division by the radix, most significant digit last
Scenario support
255 = ff = 11111111 · 755₈ = 493 · −5 at 8 bits = 11111011
Educational estimate
Planning support from the values you enter — not professional advice.

Hex is binary, regrouped

Hexadecimal is not a rival number system to binary. It is the same bits with the lines drawn in different places — and once that clicks, most of the difficulty disappears.

Sixteen is two to the fourth, so exactly four bits make one hex digit, with no remainder and no carrying between groups. The binary number 1101 0011 1010 is d3a in hex, and you can check that by converting each group of four on its own: 1101 is d, 0011 is 3, 1010 is a. No arithmetic crosses a group boundary, which is exactly what makes it a regrouping rather than a conversion.

That is the entire reason hex exists. A byte is eight bits, so it is always exactly two hex digits — 00 to ff — which makes a memory dump readable and a colour code compact. Decimal has no such relationship, because ten is not a power of two, so a byte in decimal runs from 0 to 255 with a variable number of digits and no clean mapping onto the bits at all.

Octal works the same way with three bits per digit, which is why Unix file permissions are octal: each rwx group is exactly three bits, so 755 is 111 101 101 and the digits line up with the permission groups one for one.

The tool shows the grouping alongside the answer for any power-of-two base, and deliberately shows none for decimal or base 36 — inventing a grouping for a base that has no clean bit relationship would be a misleading picture rather than a helpful one.

A negative needs a width

“What is −5 in binary?” is not a question with a single answer, and a converter that gives one is hiding something.

Hardware stores negative integers in two’s complement, which works by fixing a width and using the top bit as the sign. At 8 bits, −5 is11111011. At 16 bits it is 1111111111111011. Same number, different strings, and neither is more correct than the other — the width is a property of the storage rather than of the value.

So this tool asks for a width as soon as the value goes negative, and offers 8, 16, 32 and 64.

The important part is what happens at the edges. The signed range at n bits is −2n−1 to 2n−1−1 — asymmetric, because zero takes one of the positive slots. At 8 bits that is −128 to +127. Ask for −200 and there is no honest answer, so the tool refuses it.

That refusal matters more than it sounds. A naive implementation computes 256 + (−200) = 56 and returns 00111000 — which is a perfectly valid byte, and is the encoding of positive 56. Nothing about it looks wrong. That silent wrap is the actual bug this page was built to avoid, and it was caught in testing before any of this shipped.

Where each base is actually used

Binary is how the machine stores everything, and is worth reading directly mainly for flags and bitmasks — where each bit means something on its own rather than contributing to a magnitude.

Octal survives almost entirely for Unix permissions, for the grouping reason above. 644 is read-write for the owner and read-only for everyone else; 755 adds execute. It also appears in some legacy file formats and in older minicomputer documentation, where word sizes were multiples of three bits.

Hexadecimal is the working notation of modern computing: memory addresses, byte dumps, colour codes such as #d3a, MAC addresses, hashes and UUIDs. Anywhere bytes need to be written down, hex is how it is done.

Base 32 appears in identifiers meant to be typed or read aloud, because five bits per character allows an alphabet that omits the easily confused characters. Base 36 uses every digit and letter and turns up in short URLs and compact IDs, where density matters more than bit alignment — it is not a power of two, so it has no bit grouping at all.

Reading a byte

A byte is eight bits, which is 0 to 255 unsigned, −128 to +127 signed, and always exactly two hex digits. Those three facts cover most of what a byte dump asks of you.

The place values from the left are 128, 64, 32, 16, 8, 4, 2, 1 — so 11111011 read as unsigned is 128+64+32+16+8+2+1 = 251, and read as signed at that width it is −5. The same eight bits, two different numbers, and only the context tells you which is meant. That ambiguity is not a flaw in the notation; it is why type declarations exist in programming languages.

For hex, the two digits are the high and low nibble: fb is f (15) in the sixteens and b (11) in the units, so 15×16+11 = 251. Getting used to reading a hex byte as two nibbles is the single most useful habit here, because it makes the bit pattern visible without converting anything.

One thing this page cannot help with: byte order. A multi-byte value stored little-endian appears with its bytes reversed relative to how you would write the number, and no conversion can tell which order a dump used — only the format specification can.

Doing it in a spreadsheet

Excel and Google Sheets have the pairs directly: =DEC2HEX(A1), =HEX2DEC(A1), =DEC2BIN(A1), =BIN2DEC(A1), =DEC2OCT(A1) and =OCT2DEC(A1), plus the direct =HEX2BIN and =BIN2HEX for the regrouping case.

Two limits are worth knowing before you rely on them. DEC2BIN only handles −512 to 511 — ten bits — which is far narrower than most work needs, and it fails rather than truncating. DEC2HEX reaches further but tops out at 239, so large addresses and 64-bit values are out of range for both.

These functions also handle negatives in two’s complement at their own fixed width, which is not the width you are probably working in. If you need a specific width, the honest route is =DEC2BIN(A1,8) with the places argument for positives, and computing =256+A1 yourself for 8-bit negatives — with a range check, since the sheet will not warn you about the wrap either.

Related calculators

Other ways of writing the same quantity:

Data StorageBytes, KB, MB, GB and TB alongside the binary KiB, MiB, GiB and TiB — and why a 1 TB drive shows as 931 GB.
Roman NumeralsNumbers to Roman numerals and back, 1 to 3,999 — reading the older spellings like IIII and writing the standard modern form.
Million, Billion and TrillionThousand to trillion in both naming conventions, since a billion is 10⁹ in the US and 10¹² across much of Europe.
AngleDegrees, radians, gradians, arcminutes and arcseconds — and why a spreadsheet’s SIN(90) returns 0.894 rather than 1.
Lakh and CroreConvert between the Indian system (lakh, crore, arab) and the international one, with 2,2,3 comma grouping and the amount in words.
PercentageSolve X% of Y, what percent X is of Y, reverse percentage, increase/decrease, discounts, and tax, tip, or commission.

More in Conversion, or browse all calculators.

Sources and methodology

Nothing here is fetched and there is no data feed. There are no measured factors either — a base conversion is exact by construction. What the sources settle is the part that is a convention: the fixed-width integer representations that make a width necessary before a negative can be written at all, and the octal grouping behind Unix permissions.

Conversion note

Base conversion is exact by construction — the same integer written in different notations — and this engine uses arbitrary-precision integers, so a value past the 2^53 point where ordinary numbers stop being exact keeps every digit. Two things are conventions rather than mathematics, and both are stated on the page rather than assumed. Two’s complement is one of several ways to represent negative integers, and it is the one essentially all modern hardware uses; the width is a property of the storage rather than of the number, so a negative has no single binary form. And leading zeros carry no value but do carry meaning in context — a 32-bit register dump pads to 32 digits, and dropping the padding loses information about the field width even though the number is unchanged. For protocol work, register maps or file formats, the specification defines both the width and the byte order, and byte order is not something this page can infer.

How we calculate · Found an error? email us

Authorship & verification

Written and maintained by , a business operator who builds spreadsheet-based calculators.

What's changed (4 updates)

Published 7 September 2026

  1. Published the Numeral Base Converter: binary, octal, decimal, hex, base 32 and base 36.
  2. Shows the bit GROUPING rather than only the answer — four bits is exactly one hex digit and three is one octal digit, which is the whole reason those bases exist. Decimal and base 36 deliberately get no grouping, since neither is a power of two and inventing one would be a misleading picture.
  3. Handles negatives honestly: a negative has no binary form without a WIDTH, so the tool asks for one and refuses a value outside that width’s signed range. The refusal matters — a naive implementation encodes −200 at 8 bits as 56, a valid encoding of a different number, and that silent wrap was caught in testing before release.
  4. Arbitrary-precision integers throughout, so a 20-digit hex constant keeps every digit past the point where ordinary numbers stop being exact.

Add this calculator to your site

Responsive embed — and private: nothing your visitors type leaves their browser.