Number Base Converter
Convert whole numbers between binary, octal, decimal, hexadecimal and any base from 2 to 36, exactly, with two's complement views for 8 to 64 bits.
Reviewed 23 November 2026 · Free · No account needed
How to use
- Choose the base your number is written in (binary, octal, decimal, hex or a custom base).
- Type or paste the number: prefixes like 0x or 0b, spaces and underscores are accepted.
- Read the value in every common base plus one custom base of your choice.
- Check the two's complement rows to see how a negative or signed value is stored in 8, 16, 32 and 64 bits.
Example
Input: 255 (decimal)
Output: 11111111 binary · 377 octal · FF hex · 73 in base 36
How it works
The digits are read in the chosen base into an arbitrary-precision integer, which is then written out again in each target base, so no precision is lost on large values.
Value = Σ digit × base^position, read right to left. Writing it back divides repeatedly by the target base and collects the remainders. Two's complement of a negative n in k bits is 2^k + n.
Limits and edge cases
- Whole numbers only: fractions such as 0.1 in binary are not supported.
- Bases from 2 to 36 are supported, using the digits 0-9 and letters a-z.
- Two's complement is shown for 8, 16, 32 and 64 bits; a value that does not fit is marked instead of wrapped.
- Values of any size work because the arithmetic uses BigInt, but extremely long inputs may be slow on old phones.
- A digit that is not valid in the chosen base (for example 2 in binary) is reported by name.
- Leading 0x, 0b and 0o prefixes are removed when they match the selected base.
- -128 fits in 8 bits as 10000000, but 128 does not and is flagged as out of range.
Privacy
Numbers are converted locally in your browser. Nothing is uploaded, logged or stored.
About this page
Written and reviewed by Toolnexo on 23 November 2026. The limits above describe the published tool, not an idealised version of it. If a result looks wrong or the page is unclear, email [email protected] with the tool URL and what you entered. Corrections are published here.
Guides that use Number Base Converter
Related tools
Questions about Number Base Converter
How large a number can I convert?
As large as your browser has memory for. The converter uses BigInt arithmetic, so 18446744073709551615 converts exactly to ffffffffffffffff in hex with no rounding, unlike calculators that switch to floating point above about nine quadrillion. Extremely long inputs, thousands of digits, may take a moment on slower devices.
Can it convert fractions, like 0.5 to binary?
No, this tool handles whole numbers only. Fractional conversion needs a decision about how many digits to keep and how to round, because many decimal fractions repeat forever in binary. Rather than hide that choice, the tool declines input containing a decimal point and tells you the character is not a valid digit.
What is two's complement and why is it shown?
Two's complement is how computers store signed integers: a negative number n in k bits is stored as 2^k + n. The rows for 8, 16, 32 and 64 bits show that bit pattern, grouped in bytes. If the value does not fit in a width, that row says so instead of silently wrapping around.
Which characters can I use for bases above 10?
Letters a to z represent digits 10 to 35, case-insensitively, so base 36 uses 0-9 and a-z. Prefixes 0x, 0b and 0o are stripped when they match the input base, and spaces, commas and underscores are ignored so you can paste grouped values like 1111_0000.