Number Base Converter

Convert integers between binary, octal, decimal, and hexadecimal with BigInt precision.

Runs locally in your browser. No account required.

Practical usage guide

What this tool does

Number Base Converter translates signed integers between binary, octal, decimal, and hexadecimal, one value per line. It uses JavaScript BigInt so integers larger than the safe Number range keep their exact value instead of being rounded during conversion, which is important for identifiers, bit masks, protocol fields, and large test values.

The input base can be selected explicitly or detected automatically from common 0b, 0o, and 0x prefixes, with unprefixed values treated according to the automatic decimal rule. The output base controls the digits, while Prefix and Uppercase change presentation only; they do not change the underlying integer.

Quick start

Enter one integer per line

Paste up to 200 values, keep the complete input within 200,000 characters, and keep each physical line within 4,096 characters. Signs belong to the integer, while spaces, comments, separators, decimal points, and exponent notation are not part of the supported numeric syntax.

Confirm the input base

Use Auto for ordinary decimal values and explicitly prefixed binary, octal, or hexadecimal values. Select base 2, 8, 10, or 16 when unprefixed digits must be interpreted with a known contract.

Choose the output representation

Select binary, octal, decimal, or hexadecimal output. Enable Prefix when a 0b, 0o, or 0x marker is helpful, and enable Uppercase when hexadecimal A-F must follow a documentation or code convention.

Verify signs and boundary values

Check zero, negative values, maximum field values, and leading-zero inputs against the destination system. Conversion preserves the integer value but cannot infer signed width, padding, or overflow rules.

Common use cases

Inspect flags and bit masks

Convert a decimal or hexadecimal flag value to binary so set bits are easier to compare with protocol, permission, or feature-mask documentation.

Translate large integer identifiers

Convert database IDs, sequence values, and externally supplied integer keys without the precision loss that would occur through JavaScript Number.

Debug protocol and hardware fields

Move between documentation that uses hexadecimal, logs that print decimal, and binary layouts used to explain register or packet fields.

Prepare batch test fixtures

Convert a line-oriented set of boundary values into the notation expected by tests, command-line arguments, configuration, or source-code constants.

Limitations and important notes

Only integers are supported

Fractional values, decimal points, scientific notation, repeating fractions, and floating-point bit representations are outside the tool scope. Convert or analyze those values with a numeric library designed for fractions or IEEE 754.

Base conversion does not apply an integer width

BigInt represents a mathematical signed integer. The tool does not automatically produce two-complement bytes, sign extension, fixed-width padding, overflow, endianness, or a target language type.

Input, batch, and line limits are enforced

A run accepts at most 200 non-empty values, 200,000 total input characters, and 4,096 characters per line. Very large integers can still be expensive to parse or display, so use streaming or specialized tooling for bulk datasets.

Prefixes are representation conventions

Some databases, configuration formats, and programming languages do not accept 0b, 0o, or 0x prefixes, or interpret leading zeros differently. Match the exact syntax required by the destination.

Examples

Mixed integers to hex

Convert decimal, binary, and hexadecimal integers in one batch.

Frequently asked questions

Can it convert integers larger than JavaScript's safe integer limit?

Yes. The converter uses BigInt, so integer precision is retained even for values much larger than Number.MAX_SAFE_INTEGER.

Does it support fractions or scientific notation?

No. This tool intentionally supports signed integers only. Values such as 10.5 or 1e6 are rejected.

Can I convert multiple values at once?

Yes. Put one integer on each line. Auto mode lets prefixed binary, octal, hexadecimal, and unprefixed decimal values share the same batch.

Related tools