~/allthedamn.tools

Number Base Converter

Every base at once — edit any field, the rest follow. Big numbers stay exact.

runs entirely in your browser
digits
Signed view (two’s complement)
widthbinaryhexsigned value
8-bit11001010CA-54
16-bit000000001100101000CA202
32-bit00000000000000000000000011001010000000CA202
64-bit000000000000000000000000000000000000000000000000000000001100101000000000000000CA202
common values

decimal · binary · hex · octal — tap a row to load it.

Converted on your device with arbitrary-precision integers, up to 4,096 bits at a time. Nothing you type leaves this page.

How a base actually works

A base is a promise about what each position in a number is worth. In base 10 the positions are worth 1, 10, 100, 1000 — powers of ten — so 202 means two hundreds, no tens, and two ones. Change the base and only the position values change: in base 2 they are 1, 2, 4, 8, 16, and so on, and in base 16 they are 1, 16, 256, 4096. The digits are the same idea in every base; there are just more or fewer of them to go around.

So converting binary to decimal is addition. Take 1101: the positions from the right are worth 1, 2, 4, and 8, and the digits switch three of them on — 8 + 4 + 1 = 13. Going the other way is division: divide by 2 repeatedly and read the remainders backwards. Hexadecimal works the same way with sixteen digits, which is why it needs letters — A through F stand for ten through fifteen, so 202 becomes CA, meaning twelve sixteens plus ten.

This page shows five bases at once and every one of them is an input. Type in any row and the others follow on the keystroke, because there is no such thing as a from-field and a to-field here — a number is one value with several spellings, and the tool shows you all of them.

Why other converters go wrong on long numbers

JavaScript's ordinary number type is a 64-bit float, and it stops being able to count one at a time above 9,007,199,254,740,992 — two to the fifty-third. Past that point some integers simply have no representation, and the language rounds to the nearest one it can hold, silently. A converter built on parseInt or Number inherits that ceiling exactly: feed it 9007199254740993 and it will hand back a confident, wrong answer ending in 992, with nothing on screen to suggest anything happened.

That is not a hypothetical. One well-known converter refuses any input longer than 63 characters; others quietly corrupt long values instead. Sixteen or seventeen digits is not an exotic number — it is a Twitter ID, a database key, a 64-bit hash, a hardware address.

This tool uses arbitrary-precision integers throughout, so 9007199254740993 converts to 20000000000001 in hex and back again unchanged. There is one ceiling, and it is a guard against a pasted megabyte freezing the page rather than a limit the arithmetic imposes: 4,096 bits. That covers every decimal number of 1,233 digits or fewer, and every hexadecimal one of 1,024 or fewer. It is set on the value rather than on the digit count, so anything this page will show you in one base, it will read back in every other.

The signed view, and what a bit pattern means

Computers do not store a minus sign. They store a fixed number of bits and agree on a convention for reading them, and the convention that won is two's complement: the top bit carries a negative weight. In eight bits the positions are worth −128, 64, 32, 16, 8, 4, 2, 1, so 11111111 is −128 + 127 = −1. That is why a byte of all ones reads as −1 and as 255, depending only on whether you agreed to treat the top bit as a sign.

The signed view answers that question in both directions at once. Type −1 and it shows FF, FFFF, FFFFFFFF and the 64-bit form. Type 255 and it tells you that as an 8-bit signed value it is −1, while as a 16-bit value it is still 255 — the same bits, a different width, a different meaning. When a value needs more bits than the width has, the row says so instead of quietly chopping the number down to fit.

The widths on offer are the ones that correspond to real integer types: 8, 16, 32 and 64 bits. If you are staring at a value from a debugger, a register dump, or a wire protocol and it looks absurdly large, this is usually the table that explains it.

What this page does and does not do

It converts whole numbers between bases 2 and 36, in either direction. Binary, octal, decimal and hex are always on screen together; one further row takes any base from 2 to 36. Bases above 16 use the usual extension of the digit alphabet — 0 through 9, then A through Z — which is what base 36 identifiers in URLs and short links are written in. Letters are accepted in either case and displayed in upper case.

Paste is meant to work without cleanup. A leading 0x, 0b or 0o prefix is understood when it matches the base you are pasting into, spaces and underscores are ignored so a value copied out of source code goes straight in, comma-grouped numbers from a spreadsheet parse as written, and a minus sign is read whether it arrives as an ASCII hyphen, an en dash, or the true minus sign a document or PDF pastes in. The digit grouping on screen — nibbles for binary, byte pairs for hex, thousands for decimal — is for reading only; the copy buttons always give you the plain value.

Fractions are out of scope. This converts integers, so 0.101 in binary is not something it will read, and it will tell you the dot is not a digit rather than guessing. Bases below 2 or above 36 are not offered because there is no agreed digit alphabet for them.

fair questions

How do you convert binary to decimal?
Multiply each digit by the value of its position and add the results. Positions run right to left as 1, 2, 4, 8, 16 and so on. For 1101 that is 8 + 4 + 0 + 1, which is 13. The tool does this live, but the arithmetic is short enough to check by hand.
What is hexadecimal?
Base 16 — sixteen digits, written 0 to 9 then A to F, where A is ten and F is fifteen. It is popular because it lines up with binary exactly: one hex digit is four bits, so two hex digits are one byte. That is why colours, memory addresses, and hashes are written in hex rather than decimal.
Why do programmers use hex and binary instead of decimal?
Binary is what the hardware actually stores, so it is the honest view when individual bits matter — flags, masks, permissions. Hex is the same information at a quarter of the length, with a clean four-bit boundary per digit, so it stays readable. Decimal has no relationship to bit boundaries at all.
What is the largest number this can convert?
Any value up to 4,096 bits, which covers every decimal number of 1,233 digits or fewer and every hexadecimal one of 1,024 or fewer. The arithmetic itself is arbitrary-precision and has no ceiling; that one exists so a pasted megabyte cannot freeze the page. Converters built on ordinary JavaScript numbers lose accuracy after about 16 digits.
What is two's complement?
The convention computers use to store negative whole numbers: within a fixed width, the top bit carries a negative weight. In eight bits, −1 is 11111111, which is FF in hex. The signed view on this page shows the pattern at 8, 16, 32 and 64 bits — or says when a value needs more bits than the width has — and tells you what a given pattern means as a signed number.
Do the numbers I type get uploaded?
No. Every conversion runs in your browser, nothing is sent anywhere, and the page keeps working with the network disconnected.

this site is built on Guardrails, the guard-railed boilerplate for shipping real products with AI agents.