Number Base Converter

Binary, hex, and two's complement.

Type in any field and every other base updates. Flip individual bits, switch between 8, 16, 32, and 64-bit widths, and read the same bits as signed or unsigned.

Zero retention: your data never leaves this browser. Verify it yourself in DevTools

Loading the toolbox.

About 2base

How Can You Verify That Nothing Leaves This Browser?

You do not have to take our word that your data stays here. Developer tools show every request a page makes, so you can watch this page work and confirm that nothing is sent. The check takes under a minute.

  1. Open your browser developer tools with F12, or Cmd+Option+I on a Mac, and select the Network tab.
  2. Reload the page and let it finish. You will see the page's own files, its web fonts, and one anonymous page-view request. Nothing has been typed yet, so none of them can contain your data.
  3. Click the clear icon in the Network tab so that the log is empty.
  4. Use the tool with your own input.
  5. Look at the Network tab again. It is still empty. For extra proof, turn on offline mode after the page loads and the tool keeps working.

Only two things can add a line to that log, and neither carries your data. Submitting the feedback form sends the vote and comment you typed. Typing characters in a script the page has not displayed yet, such as Cyrillic or Greek, can make the browser fetch the matching font file, and that request names only the font.

The production site also sends a Content-Security-Policy header that tells your browser to refuse connections to anywhere except this site and the anonymous analytics endpoint, so a coding mistake could not quietly send your data elsewhere.

How Do Number Bases Work?

A base, or radix, is how many digits a number system uses. Decimal uses ten, binary two, octal eight, and hexadecimal sixteen, with A to F standing for 10 to 15. Each position is worth the base times the position to its right, so hex FF is 15 times 16 plus 15, which is 255, and binary 1111 1111.

Programmers use hex because each hex digit is exactly four bits, so a byte is always two hex digits. Octal survives in Unix file permissions, where 755 means rwx for the owner and r-x for everyone else.

What Is Two's Complement?

Computers store negative integers in two's complement. In an 8-bit value the top bit is worth minus 128 instead of plus 128, so 1111 1111 is minus 1 and 1000 0000 is minus 128. The same bits mean 255 and 128 when read as unsigned. Addition works identically either way, which is why hardware uses it.

2base shows both readings at once. You can now type a negative decimal into the signed field and see its two's complement bits, which the original tool rejected.

What Happens When a Number Is Too Big?

A value that needs more bits than the chosen width is reduced to its low bits, exactly as a fixed-width integer overflows in C, Rust, or Java. The original 2base did this silently. Now the page tells you, so you can choose a wider width. All arithmetic uses BigInt, so 64-bit values are exact; ordinary JavaScript numbers lose precision above 2 to the power 53.

What Are the Input Rules?

  • Prefixes 0x, 0b, and 0o are accepted in the matching field.
  • Spaces and underscores are ignored, so 1111_0000 and FF FF both work.
  • Letters are case-insensitive, and a custom base can be anything from 2 to 36.
  • A digit that does not exist in the base, such as 9 in octal, is reported instead of guessed.

What Other Tools Are in the Encode / Crypto Lane?

  • 2hash: MD5, SHA-1, SHA-256, SHA-384, and SHA-512 of text or a file, plus HMAC and a checksum verifier.
  • 2otp: Live RFC 6238 codes from a pasted secret or otpauth URI. The secret stays in this tab's memory.

Elsewhere in the toolbox: 2uuid, 2gitignore, 2csp, 2htaccess, and more on the 2toolbox home page. Part of the 2suite.io privacy-first ecosystem.

Frequently Asked Questions

How do I convert hex to binary by hand?

Replace each hex digit with its four-bit pattern: A is 1010, F is 1111, so AF is 1010 1111.

Why is 0xFFFFFFFF equal to -1?

In 32-bit two's complement, all bits set means minus one. Read as unsigned, the same bits are 4,294,967,295.

What is the largest 64-bit number?

Unsigned, 18,446,744,073,709,551,615. Signed, 9,223,372,036,854,775,807.

Does it support fractions?

No. 2base converts integers, which is what bit-level work needs.

Was this helpful?