tooldura

All tools

Binary & Hex Converter

Convert a number between binary, octal, decimal and hex, exact at any size

8 bits · 1 byte

The same bits at a fixed width
WidthUnsignedSignedHex
8-bit255-1FF
16-bit25525500FF
32-bit255255000000FF
64-bit25525500000000000000FF

On the highlighted rows the top bit is set, so the same bytes mean one thing to an unsigned type and another to a signed one.

About Binary & Hex Converter

The Binary & Hex Converter takes one number and shows it in binary, octal, decimal and hexadecimal at once, plus any base up to 36. It runs on arbitrary-precision integers rather than JavaScript's ordinary numbers, which matters more than it sounds: a plain number stops being exact above 2^53, so a 64-bit hex value pasted into most online converters comes back with its last four digits quietly rounded off. Here 0xFFFFFFFFFFFFFFFF converts to 18446744073709551615, which is the right answer. Prefixes are understood, so pasting 0xFF or 0b1010 moves the selector for you, and the table underneath shows how the same bits read at 8, 16, 32 and 64 bits, signed and unsigned, which is the question behind most trips to a converter.

FreeNo paywalls or tiers
No SignupNothing to create
InstantNo setup, no install
Any DeviceMobile, tablet, desktop

The guide behind this tool

Where Hex Converters Quietly Round Off Your 64-Bit Numbers

FFFFFFFFFFFFFFFF is 18446744073709551615, but a lot of tools say ...552000. The 53-bit significand behind it, and why all ones means minus one.

8 min read

How to use Binary & Hex Converter

  1. 1

    Type or paste your number in the Value box.

  2. 2

    Set “Read as” to the base you typed it in, or just include a 0x, 0b or 0o prefix and let the tool set it.

  3. 3

    Read the value in binary, octal, decimal and hexadecimal, and click any of the four to copy it without the digit grouping.

  4. 4

    Pick a different base from the “Any base” dropdown if you need something outside the usual four.

  5. 5

    Check the width table if the number is negative, or if the top bit is set and something is reading it as signed.

Frequently Asked Questions

Because the bits do not say which one they are. A 32-bit value with every bit set is 4294967295 if whatever reads it treats the top bit as part of the number, and -1 if it treats that bit as a sign under two's complement. Both readings are correct; only the type declaration decides. The width table shows both for every width the value fits in, and highlights the rows where they disagree.