Home

Number Base Converter

Convert integers between binary, decimal, hexadecimal, octal and any base from 2 to 36, with exact results.

Enter your numbers

Live calculation
Try an example:

Up to 1,000 integer digits. A leading sign, matching 0b/0o/0x prefix and single underscores between digits are accepted. No expressions or decimal fractions.

Whole-number radix from 2 to 36. Common bases: binary 2, octal 8, decimal 10, hexadecimal 16.

Whole-number radix from 2 to 36. Common bases: binary 2, octal 8, decimal 10, hexadecimal 16.

Also included in this result: Output prefix (bases 2, 8 and 16): Include 0b / 0o / 0x.

Additional settings (1)

Adds 0b, 0o or 0x for bases 2, 8 and 16. Other bases use digits only.

Results update as you type. Example values are editable.

Converted value

0xFF

Exact integer in base 16. Negative values use a minus sign, not two’s complement.

Inputs stay on this page. Reloading clears unsaved changes.

More results, charts and tables
Decimal255
Binary0b11111111
Octal0o377
Base 3673
How it is calculated
Each input digit is accumulated as value × input base + digit. Output uses repeated division by the output base. All arithmetic is exact BigInt integer arithmetic, including values above 2⁵³ − 1. Bases 2–36 are supported. A leading + or − and matching 0b/0o/0x prefixes are allowed; a single underscore may separate digits. Letter digits are case-insensitive; output uses uppercase letters. Leading zeros are removed. A value such as 1e3 is digits in base 16, not scientific notation; in base 10 it is rejected. Fractions, decimal points and expressions are not supported. Limit: 1,000 digits per input.

Number Base Converter

CalcsDecoded.com

Converted value

0xFF

Exact integer in base 16. Negative values use a minus sign, not two’s complement.

Result breakdown
MeasureResult
Decimal255
Binary0b11111111
Octal0o377
Base 3673

Inputs used

  • Integer to convert: 255
  • Input base: 10
  • Output base: 16
  • Output prefix (bases 2, 8 and 16): Include 0b / 0o / 0x

Method and assumptions

Each input digit is accumulated as value × input base + digit. Output uses repeated division by the output base. All arithmetic is exact BigInt integer arithmetic, including values above 2⁵³ − 1. Bases 2–36 are supported. A leading + or − and matching 0b/0o/0x prefixes are allowed; a single underscore may separate digits. Letter digits are case-insensitive; output uses uppercase letters. Leading zeros are removed. A value such as 1e3 is digits in base 16, not scientific notation; in base 10 it is rejected. Fractions, decimal points and expressions are not supported. Limit: 1,000 digits per input.

Examples and assumptions

Convert an integer exactly between bases 2–36. Choose both bases explicitly; a negative value keeps its minus sign.

Decimal 255 to hexadecimal

0xFF.

255 = 15 × 16 + 15. Both digits are F in hexadecimal.

A number above the JavaScript safe-integer range

0x20000000000001.

This is 2⁵³ + 1. Parsing the text directly as an integer preserves the final 1.

Negative binary to decimal

-10.

Binary 1010 is 8 + 2. This is signed-magnitude text, not a fixed-width two’s-complement pattern.

Before you use the result

  • Whole integers only; decimal points and expressions are rejected. In bases that allow E, it is a digit, not an exponent.
  • Each input is limited to 1,000 digits. Prefixes must match the selected base; underscores can separate digits. Leading zeros are not retained.
  • Use Bitwise Calculator when you need a fixed width or two’s-complement interpretation.
Calculation checks and references

Independent Python integer references verify every base from 2 to 36, signs, values above 2⁵³, inverse conversions, prefixes, separators and invalid digits.

Reference cases checked: . Checks are automated reference calculations; an independent professional review is not claimed.

References explain definitions, rules or context; they do not endorse CalcsDecoded.com. See our calculation methodology for the testing and updating standard.

Frequently asked questions

Does this support integers larger than 2⁵³ − 1?

Yes. Input is parsed directly into exact BigInt arithmetic, with a limit of 1,000 digits per input.

Can I enter binary or hexadecimal prefixes?

Yes, 0b, 0o and 0x are accepted when they match the selected input base. A leading sign is allowed.

Are negative values two’s complement?

No. This converter preserves the mathematical integer with a minus sign. Use Bitwise Calculator for a fixed-width two’s-complement pattern.