Number Base Converter

Convert whole numbers exactly between bases 2 through 36, including binary and hexadecimal.

How to use

These are example steps; replace the values for your task.

  1. Select base 16 and enter ff.
  2. Choose base 10 or base 2 as the target.

Enter values

Conversion result

—

About this tool

Whole numbers are parsed with BigInt, avoiding the precision loss that normal JavaScript numbers can introduce for large values. Negative integers are supported.

Fractions, prefixes such as 0x, and digit separators are not accepted. Bases above ten use lowercase letters in output.

Continue this task

Try a use case and check the result

Represent large or negative integers in another base without losing integer digits.

Example buttons replace the inputs and settings above and calculate. Restore previous input steps back one example at a time. After trying multiple examples, repeat restore to return to your original input. This history is lost when the page closes.

Convert an integer beyond ordinary number precision

Input and settings

Input: 9007199254740993 / From: base 10 / To: base 16

Expected result

20000000000001

Convert a negative hexadecimal integer to decimal

Input and settings

Input: -FF / From: base 16 / To: base 10
Do not add 0x.

Expected result

-255

How to read the result

The first example uses BigInt integer arithmetic to preserve 9007199254740993 exactly. Negative values use a leading minus sign. Input letters are case-insensitive and output letters are lowercase. Leading zeroes are normalized as part of the number.

Scope and limits

The UI offers bases 2, 8, 10, 16 and 36. Fractions, exponents, digit separators, prefixes such as 0x and two’s-complement interpretation are unsupported. Outer whitespace is trimmed; internal whitespace is invalid. Very long input depends on device processing time and memory.

Verification: existing convertBase and parseBase checks cover a large-integer round trip, -FF→-255 and rejection of invalid digits, fractions and prefixes, compared with rendered output.

Continue with the next task

Convert hexadecimal ff to decimal

With base 16 as the source, ff becomes 255 in decimal or 11111111 in binary.

Each digit updates the accumulated value as previous value × base + digit. The integer is held as a BigInt.

Valid digits depend on the source base. For example, entering 2 in base 2 produces an error.

Keep the digits of a large integer

Decimal 9007199254740993 converts to hexadecimal 20000000000001. Converting it back restores the original integer. Decimals and a 0x prefix are rejected: select base 16 and paste only the digits.

Frequently asked questions

Are large integers exact?

Yes. BigInt preserves digits beyond the normal safe-integer range.

Can it convert fractions?

No. This tool handles whole numbers only.

Can I enter a 0x prefix?

No. Enter the digits only.

Related tools

Inputs and storage

Keep any content you need before clearing. This tool does not autosave inputs or results. Reloading or closing the page, clearing inputs or resetting may discard your work.

Favorites and language preferences are stored separately and may be lost when site data is cleared. Tool resets and site-data deletion do not delete files already downloaded to your device.

Explore tools & games

All 120 tools · 16 games

All 120 tools · 16 games

Text & writing 26

Calculators & converters 22

Date & time 12

Images & PDF 26

Data & web 28

Random & handy 6

Games 16