🔒 Processed locally in your browser — no data uploaded
← Back to Home

Number Base Converter

Input value
Conversion result

What the Number Base Converter does

Number Base Converter translates an integer between binary, octal, decimal and hexadecimal in one pass. Type a value, pick the base you typed it in, and the page prints all four representations side by side in a small table. Programmers use it to read memory addresses, colour codes and file permissions, where the same number appears as 0xFF, 255 or 11111111 depending on the context. Results update as you type, so you can compare bases without pressing a button.

The converter knows the four bases you are most likely to meet: 2, 8, 10 and 16. Hex output is shown in upper case, matching the convention used in datasheets and code, and negative values keep their minus sign. Everything runs inside the page with the browser's own number parsing, so a serial number, a register value or a colour channel never leaves your machine. The default input is 255, which is handy for seeing all four forms of a byte at once.

How to use it

  1. Choose the input baseOpen the dropdown next to the number box and pick the base your value is written in. Decimal is selected first, so any plain number you paste is read correctly without extra steps.
  2. Type or paste a valueEnter digits that belong to the chosen base: only 0 and 1 for binary, 0 to 7 for octal, 0 to 9 for decimal, and 0 to 9 plus A to F for hexadecimal.
  3. Read all four resultsThe table below the input shows binary, octal, decimal and hex at once. Copy the row you need instead of converting once per base; every row is regenerated on each keystroke.
  4. Fix a rejected entryIf the page reports a format error, the digit set does not match the base you selected. Switch the base or edit the value, then check the decimal row against the number you expected.

Options and formats

Binary (Base 2)Two digits only. The usual view of bitmasks, flags and hardware registers, and the format you paste into a bit-level debugger or a shift calculation.
Octal (Base 8)Groups of three bits, written with digits 0 to 7. Still used for Unix file permissions such as 755 and for some legacy protocol headers.
Decimal (Base 10)The everyday base for prices, counts and measurements. Choose it as the source when your value comes from a spreadsheet, an invoice or a report.
Hexadecimal (Base 16)Shown in upper case, with digits 0 to 9 and letters A to F. The standard way to write memory addresses, RGB colours, code points and byte dumps.
Negative valuesA leading minus sign is carried through the whole conversion. Wraparound is not applied, so a signed byte is not reduced to a value between minus 128 and 127.

Things to watch out for

Fractions are cut offNumber parsing stops at the decimal point, so 255.75 is converted as 255. Enter a whole number, or scale the value up until it is an integer, convert, then place the decimal point back.
Digits outside the base failCharacters that do not belong to the selected base are rejected rather than skipped. Typing 2 while binary is chosen returns a format error, which usually means the base dropdown sits on the wrong setting.
Prefixes are not requiredWrite ff rather than 0xff. A 0x prefix is tolerated when hexadecimal is selected, but the same string read as decimal returns 0, so strip prefixes whenever a result looks smaller than expected.
Long numbers lose precisionConversion goes through the browser's floating-point numbers, which hold a limited number of exact digits. Very long inputs may round at the tail, so verify high-precision values with a big-integer library instead.

Frequently asked questions

Why does the result table show four rows instead of one?

The page always converts to every supported base, not only the one you asked for. That saves a second trip when you need to compare a hex address with its decimal equivalent, and it makes it obvious when a value sits on a byte boundary.

How do I convert a negative number such as -42?

Type the minus sign before the digits and the sign carries through all four rows. No wraparound is applied, so the tool will not show the two's complement form of a signed byte; subtract from 256 yourself if you need that view.

Can I convert a hexadecimal colour code like FF8800?

Yes. Select hexadecimal as the source base, enter FF8800, and read the decimal row. Note that the converter treats the value as one integer, so it does not split the string into red, green and blue channels for you, and it does not add the hash mark a stylesheet needs.

Which letters does hexadecimal accept?

Digits 0 to 9 and letters A to F, in either case. A value typed in lower case converts normally, and the hex row in the result is printed in upper case to match the style used in datasheets and code.

Does the tool convert floating-point numbers such as 10.5?

No. Parsing stops at the decimal point, so only the whole part is converted and everything after the point is dropped. Multiply your value until it is an integer, convert it, then place the decimal point back where it belongs in the result.

Can I use it offline or on a phone?

Once the page is loaded it works without a network connection, because the conversion runs in JavaScript inside the tab. The layout stacks on narrow screens, so the input box, the base dropdown and the result table all stay usable on a phone.