tool hub Tool Hub

Number Base

Number Base — runs in your browser. Inputs are not stored.

Runs in your browser No sign-up Free to use


Base conversion (2 / 8 / 10 / 16)

Enter values, then press Calculate.

How to use

  1. Under input base, choose decimal, binary, octal, or hexadecimal. The default is decimal.
  2. Enter an integer in value. Examples: 255, FF, 0xFF, 0b11111111.
  3. Press Convert to show binary, octal, decimal, and hexadecimal at once.
  4. If a 0b / 0o / 0x prefix is present, the prefix is read in preference to the selected input base.
  5. Press Reset to start over. Decimal fractions are not supported.

Key concepts

The number-base converter switches among binary, octal, decimal, and hexadecimal for programming, networking, and color codes. It reads the integer with parseInt, then shows all four bases with toString on one screen—easier to compare than a decimal-to-hex-only tool. Use it for color #FF, IPv4 octets, permission bit flags, and machine code. The point is that all four fields update together when you convert bit flags, colors, or port numbers.

A leading - converts negatives too. Fractional values (a decimal point) are not handled. Past JavaScript’s safe integer range (about 2^53), trailing digits can drift. Prefixes 0b, 0o, and 0x are read as bases 2, 8, and 16. Calculation stays in the browser. A prefix wins over the input-base dropdown, so 0xFF is read as hex even if the dropdown is decimal. Values such as 0.5 or fractions are not parsed.

Example

Input base decimal and value 255 converts to binary 11111111, octal 377, decimal 255, and hex ff. Entering 0xFF is also read as hex and yields the same four results. Binary 1010 is decimal 10 and hex a. Check that hex FF, decimal 255, and binary 11111111 line up. 0o377 is the same 255. Decimal 16 becomes binary 10000 and hex 10. Switch input base to 16 and enter 10 to get decimal 16.

Related: Base conversion · Text ↔ binary

Frequently asked questions

Does the number-base converter support fractions (a decimal point)?

No. Integers only. The fractional part is not truncated in a controlled way—it is ignored or only the integer is parsed. Enter integers only.

How do I convert a negative number?

You can put - in front of the value. Negative notation can differ from two’s complement in a given language; treat it as a reference.

Can I use prefixes such as 0xFF or 0b1010?

Yes. If 0b/0o/0x is present, that base is used. The 0x prefix is generally recognized in either letter case.

How does this differ from the decimal-to-hex tool?

This screen is a combined view of bases 2, 8, 10, and 16 at once. For 64-bit addresses, check the safe-integer limit first. Do not exceed the safe integer range for large integers.

Are very large integers converted exactly?

Accuracy can drop beyond JavaScript’s safe integer range. For hex colors only, a color converter may be a better fit.

Does hexadecimal only show lowercase a–f?

It is displayed as a lowercase hex string. Convert to uppercase after copying if you need that. There is no copy button; drag to copy each base field.

Number Base cover image
Your input is not sent to the server and disappears when you close the page.

Last reviewed: 2026-09-04