Numbers & Units

Number Base Converter

Convert integers between binary, octal, decimal, hexadecimal, base 32 and base 36. Arbitrarily large numbers are supported without rounding.

Binary (2)
Octal (8)
Decimal (10)
Hexadecimal (16)
Base 32
Base 36
Ready.

What it does

Enter an integer in one base and see it in all the others. Calculations use arbitrary-precision integers, so values far beyond the normal 64-bit range convert exactly.

Input rules

  • Digits are 0-9 then a-z; letters are not case-sensitive.
  • Prefixes such as 0x, 0b and 0o are accepted when they match the input base.
  • A leading minus sign is kept. Spaces and underscores are ignored, so 1111_0000 works.

Good to know

Base 32 here uses the digits 0-9a-v (not the RFC 4648 alphabet used for Base32 encoding of data).

Example

Hexadecimal ff is 11111111 in binary, 377 in octal and 255 in decimal. The Unix permission 755 is octal, which is why the chmod calculator works in base 8, and the colour #3b82f6 is three hexadecimal bytes that you can convert to decimal here one pair at a time, or read as RGB values with the colour converter.

Limits and common mistakes

  • Only whole numbers are converted. A decimal point or exponent is rejected with the offending character named.
  • Negative numbers are shown with a minus sign (-ff becomes -11111111), not as two's complement. For a fixed-width signed value, work out the bit pattern yourself.
  • Choose the input base before you type. 10 means two in binary, eight in octal, ten in decimal and sixteen in hexadecimal. An invalid digit for the chosen base, such as 2 in binary, is reported by name.
  • Base conversion is not Base64 or any other encoding. To encode bytes as text, use the Base64 encoder; to look up the number behind a character, use the ASCII table.
  • Network masks are easier to read in binary: paste an octet here, or let the CIDR / subnet calculator work out the whole range.

Examples

  • ff in base 16 is binary 11111111, octal 377, decimal 255, base 32 7v and base 36 73.
  • 0b1111_0000 in base 2 is decimal 240, hexadecimal f0 and octal 360. Prefixes such as 0b and underscores between the digits are accepted.
  • zz in base 36 is decimal 1295 and hexadecimal 50f.
  • -255 keeps its sign: binary -11111111 and hexadecimal -ff.

Large numbers stay exact

JavaScript stores ordinary numbers as 64-bit floating-point values, which are exact only up to 9007199254740991. This converter uses arbitrary-precision arithmetic, so there is no rounding. The largest unsigned 64-bit integer, 18446744073709551615, converts to hexadecimal ffffffffffffffff, to octal 1777777777777777777777 and to 64 ones in binary, with every digit correct.

Frequently asked questions

How do I convert text to binary?

Use the Text to Binary Converter. For the first 128 characters, see the ASCII Table.

Which bases are supported?

You can enter a number in base 2, 8, 10, 16, 32 or 36, and the result is shown in all of them at once. Digits above 9 are the letters a to z.

Why does hexadecimal use letters?

One digit is not enough for the values 10 to 15, so a to f are used, and base 36 goes up to z.

Is my number uploaded?

No. The conversion runs in your browser.

Privacy

This tool runs entirely in your browser. What you enter is processed on your device and is not sent to a server.

Share this tool

Your data is not included in this link.