{ }jsonkit
Format
Validate
Convert
Query
Generate
2↔16

Number Base Converter

Convert exact integers between binary, octal, decimal, and hexadecimal.
From
To
16 B · paste or drop a file
1
✓ complete16 B → 4 B0.0 ms

About Number Base Converter

The number base converter translates integers between binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). Enter one value per line to convert bit masks, color values, file permissions, protocol fields, memory addresses, or identifiers without reaching for a calculator or writing a temporary script.

Conversions use JavaScript BigInt arithmetic from the first digit to the final output. The value never passes through floating-point Number, so integers far beyond the usual 53-bit safe limit remain exact. Signed values, underscore separators, and matching 0b, 0o, or 0x input prefixes are supported.

Everything runs locally in the browser and nothing is uploaded. Choose uppercase hexadecimal output when matching technical documentation, or add conventional prefixes to binary, octal, and hexadecimal results. The engine supports arbitrary bases from 2 through 36, while the page presents the four bases developers use most often.

How it works

Select the source and destination bases

Choose BIN, OCT, DEC, or HEX for both sides. Each input character is checked against the source base, so binary rejects digits other than 0 and 1, octal rejects 8 and 9, and hexadecimal accepts 0–9 plus A–F. Errors identify the affected input line.

Keep large integers exact with BigInt

The converter accumulates digits using integer multiplication and addition, then emits the result directly in the target radix. This avoids IEEE-754 rounding and preserves huge account IDs, 64-bit masks, checksums, and other integers that ordinary JavaScript numbers can corrupt.

Use signs, separators, and prefixes

A leading plus or minus sign is accepted. Underscores can separate digit groups for readability, and the conventional 0b, 0o, or 0x prefix is accepted when it agrees with the selected input base. The output-prefix option adds the appropriate marker for bases 2, 8, and 16.

Convert several values at once

Put one integer on each line to create a matching line-by-line result. Blank lines are ignored. The converter stops at the first invalid value and reports its line, which makes it easy to correct a batch without silently returning a partial or rounded answer.

Frequently asked questions

How large can the numbers be?

Each integer can contain up to 4,096 digits. BigInt keeps every digit exact, so the practical limit protects browser responsiveness rather than numeric precision. There is no 32-bit, 64-bit, or 53-bit ceiling.

Does the converter support negative numbers?

Yes. Add a leading minus sign to any supported base. The sign is preserved separately from the magnitude and appears before an optional output prefix, as in -0xFF.

Can I paste 0x, 0b, or 0o prefixes?

Yes, when the prefix matches the selected source base: 0x for hexadecimal, 0b for binary, and 0o for octal. Decimal input does not need or accept a special prefix.

Why use BigInt instead of parseInt?

parseInt returns a floating-point Number, which cannot represent every integer above 9,007,199,254,740,991 exactly. BigInt performs arbitrary-precision integer arithmetic and avoids that rounding boundary.

Are my numbers uploaded for conversion?

No. Digit validation and base conversion happen entirely in your browser. The values never leave your device and no account is required.