A number base converter shows the same integer in different positional numeral systems. Use it to translate binary flags, octal permissions, decimal identifiers, hexadecimal values, or a custom base without routing large integers through floating-point arithmetic.
The fields update together as you type. This tool accepts integers only and uses arbitrary-size JavaScript BigInt values, so it avoids the usual safe-integer limit for the conversion itself.
How to Use the Number Base Converter
Enter an integer in any available base and read its equivalent forms immediately.
- Type a value into Binary (base 2), Octal (base 8), Decimal (base 10), or Hexadecimal (base 16).
- For another radix, set Custom base (2 to 36), then type the value in Custom base.
- Read the converted values in the other fields as they update.
- Check the status for the magnitude’s bit count and, for a negative value, the signed-representation note.
- Select Copy hex or Copy binary when you need one of those outputs.
How Positional Number Bases Represent Integers
In a positional numeral system, each digit is multiplied by a power of the base. Decimal 255, for example, is 11111111 in binary, 377 in octal, and ff in hexadecimal.
255 = 2×100 + 5×10 + 5
255 = 15×16 + 15
Binary uses digits 0 and 1; octal uses 0 through 7; decimal uses 0 through 9; and hexadecimal adds a through f. Custom bases continue through lowercase z, giving a supported range from base 2 to base 36. Input is case-insensitive, while generated digits use lowercase letters.
Conversion changes notation, not the integer itself. A hex value is not automatically a byte sequence, color, character, hash, or memory address. If the source represents encoded bytes rather than a mathematical integer, use the hex to ASCII decoder and preserve byte boundaries such as leading zeroes.
Accepted Input, Prefixes, and Separators
The parser trims the input, ignores underscores and whitespace, and accepts an optional leading plus or minus sign. That makes values such as 1_000_000 and 1111 0000 readable. Because separators are removed wherever they occur, their placement is not used to validate grouping conventions.
Matching prefixes are accepted for the three prefixed bases: 0b in Binary (base 2), 0o in Octal (base 8), and 0x in Hexadecimal (base 16). The prefix is interpreted only in its matching field. Typing 0xff into Decimal (base 10), for example, produces an invalid base-10 digit error rather than auto-detecting hexadecimal.
Generated output is normalized. It omits prefixes, plus signs, separators, and unnecessary leading zeroes. This is a mathematical conversion, so formatting information is not retained. If a protocol requires a fixed width, add the necessary padding after conversion and verify its byte or field-size rules.
Invalid digits are reported against the active base. The parser rejects decimal points and exponent notation because fractions and scientific notation are outside this tool's integer-only model. Clearing one number field clears the other converted fields rather than treating an empty string as zero.
Large Integers, Negative Values, and Bit Counts
The converter accumulates input with BigInt, not JavaScript Number. Values beyond Number.MAX_SAFE_INTEGER therefore retain their integer digits during conversion. There is no application-level digit limit in the code, although very large inputs still consume browser memory and processing time.
Negative output uses a leading minus sign in each base. It does not calculate a fixed-width two's-complement representation. For example, decimal -1 becomes binary -1, not 11111111 or a longer machine-word pattern. To derive two's complement, you must first choose a width, such as 8, 16, 32, or 64 bits, and apply that representation's rules separately.
The status reports the number of binary digits in the absolute magnitude. Zero therefore reports one bit, and a negative number has the same count as its positive magnitude plus a note explaining the minus-sign representation. This count is not a storage-size promise and does not include a sign bit.
Be cautious when moving a converted value into JSON or another tool that parses integers as floating-point numbers. The conversion can be exact here and still lose precision later. Keep large identifiers as strings when the destination cannot represent arbitrary-size integers.
Common Architecture and Security Mistakes
Do not confuse a numeral base with encryption or text encoding. Hexadecimal and binary make numbers visible in another alphabet; they provide no secrecy or integrity. Base64 also solves a different problem: it represents arbitrary bytes as text rather than interpreting one whole string as an integer. Use the Base64 encoder and decoder for that format.
Context determines whether a conversion is meaningful. A 64-character hexadecimal digest, for example, has leading-zero and fixed-width semantics that a numeric conversion can erase. Network packet fields may be unsigned and width-limited, while language runtimes may interpret the highest bit as a sign. Define width, signedness, byte order, and padding before using the result in a binary protocol.
All parsing and conversion happen locally in the browser; the tool does not upload entered values. Still, avoid exposing sensitive keys, tokens, or proprietary identifiers through clipboard history, screenshots, or shared browser sessions. Changing a value to hex does not make it safe to disclose.
Finally, treat user-provided values as untrusted after conversion. Validate the destination's allowed range and meaning before using a number for allocation sizes, permissions, database keys, or low-level offsets. Syntactic validity in base 16 says nothing about whether the resulting integer is safe for an operation.
Frequently Asked Questions
Can this converter handle integers larger than JavaScript's safe integer limit?
Yes. Its parser and formatter use BigInt, so conversion does not first coerce the value to a floating-point Number. Browser resources remain finite, and another application can still lose precision if you paste the output into a number type with a smaller range.
Which custom bases are supported?
The Custom base control is constrained to base 2 through base 36. Digits use 0–9 followed by a–z, and letter input is case-insensitive. Bases above 36 and custom alphabets are not supported.
Can I enter 0x, 0o, or 0b prefixes?
Yes, in the matching field: 0x for hexadecimal, 0o for octal, and 0b for binary. The converter does not infer a prefix in a field configured for a different base. Output is shown without prefixes.
How are negative numbers converted?
The integer's magnitude is converted and a minus sign is retained. The tool does not emit two's-complement bits because that representation requires a chosen width. The displayed bit count also measures the absolute magnitude rather than a signed storage layout.
Why did my leading zeroes disappear?
Leading zeroes are formatting, not part of an integer's mathematical value, so normalized output removes them. That can be undesirable for byte strings, checksums, colors, and fixed-width protocol fields. Preserve the original width separately and pad the converted result only according to the destination format.
References: MDN: BigInt · MDN: BigInt.prototype.toString().