UtilityPilot.Find a tool

Developer Tools

Number Base Converter

Convert an integer between binary, octal, decimal and hexadecimal. Results use exact integer arithmetic, including values larger than JavaScript’s ordinary safe-integer range.

Processed in your browserPrivacy details ↗

4,096 digits · signed integers · bases 2, 8, 10 and 16

Adjust your options

No sign-up. No upload.

How to convert between number bases

  1. Select the base used by the input: decimal, binary, octal or hexadecimal.
  2. Paste one integer. You may include a leading plus or minus sign.
  3. Select Convert integer to see the same value in all four bases.
  4. Copy the JSON report or download base-conversion.json. Each representation is a string to preserve every digit.

Only surrounding whitespace is trimmed. Grouping spaces, commas, underscores and fractional points inside a value are rejected, so a partially valid input is never silently accepted.

Binary, octal, decimal and hexadecimal

A base specifies the place-value multiplier and allowed digits. Binary uses 0 and 1; octal uses 0 through 7; decimal uses 0 through 9. Hexadecimal adds a through f for digit values ten through fifteen. Uppercase hexadecimal input is accepted, and output uses lowercase.

The number’s value stays the same when the notation changes. This is useful when reading a bit mask in documentation, converting a hexadecimal identifier to a decimal field, or checking an octal quantity. It does not translate text encodings, Base64 or arbitrary byte sequences into human language.

Number conversion examples

Input

Decimal input: 255

Result

Binary: 11111111
Octal: 377
Decimal: 255
Hexadecimal: ff

For another direction, choose hexadecimal and enter 0xff; the results represent the same value. Decimal -10 becomes binary -1010, octal -12 and hexadecimal -a. A decimal input of 9007199254740993 becomes hexadecimal 20000000000001 without losing the final unit.

Exact integers and prefix handling

The processor validates every character before constructing a BigInt. It then uses integer conversion for each supported radix, avoiding the floating-point rounding that can occur with ordinary JavaScript Number values. Leading zeros do not change the mathematical value and are omitted from the result, except that zero itself is displayed as 0.

Prefixes are optional and must match the selected base: 0b for binary, 0o for octal and 0x for hexadecimal. A decimal input beginning with 0x is rejected rather than silently switching bases. A sign comes before a prefix, as in -0xff. Negative zero normalizes to zero.

Signed values, bit widths and unsupported input

Negative output uses a minus sign. It is not a fixed-width two’s-complement bit pattern, so -1 is shown as -1 rather than an assumed sequence of eight, sixteen or thirty-two one bits. To interpret a machine register, first establish its bit width and signedness in the source system.

Input is limited to 4,096 digits. Fractions, scientific notation, separators and bases other than 2, 8, 10 and 16 are not supported. The word ff is meaningful in hexadecimal but invalid in decimal. Unicode digit lookalikes are not treated as ASCII digits. This deliberate strictness helps reveal mistakes in copied values.

Related representations

For an epoch value whose meaning is a date, use the Unix Timestamp Converter. For a hexadecimal RGB color, use Color Converter, which interprets channels rather than a general integer. Base64 encoding works on bytes, so it is a different operation from expressing one integer in another base.

When moving a long decimal result into JSON or a spreadsheet, preserve it as text if the destination cannot represent large integers exactly. A correct conversion can still be rounded later by another application.

Processing and privacy

The operation runs in your browser. The tool does not send the material you enter to a processing server or automatically save it. Reset clears the form and result from the interface; it is not a secure-erasure guarantee for browser memory. Copy and download deliberately create copies outside the tool. The website itself still makes ordinary requests for its pages and scripts. See the privacy policy for the distinction.

Frequently asked questions

Can I convert numbers above 2^53 − 1?

Yes, within the input limit. BigInt preserves the integer exactly, and the exported representations are strings.

Why is a negative binary result written with a minus sign?

No bit width was specified. The tool uses signed mathematical notation rather than assuming a two’s-complement register size.

Does this convert fractional numbers?

No. This tool accepts integers only; decimal points and exponent notation are rejected.