QiLing Tools
Sign in

🔢Number Base Converter - Binary, Hex, Decimal

Convert integers between binary, octal, decimal and hexadecimal, plus one more base of your choice from 2 to 36. Type once and get every result together, each with its own copy button. Paste a prefixed number such as 0xFF, 0b1011 or 0o17 and the input base switches automatically; numbers copied from docs or code like 1111 0000, DE AD BE EF, 1_000_000 or 1,000,000 are accepted without removing the separators first. Everything is computed with BigInt, so integers dozens or hundreds of digits long stay exact to the last digit, unlike ordinary calculators that go wrong after about 16 decimal digits. It all runs live in your browser.

Loading tool...

How to use Base Converter

  1. 1Pick the base of the number you are entering; pasting a 0x, 0b or 0o prefix switches it for you
  2. 2Enter an integer, optionally negative, with spaces, underscores or thousands commas if you like
  3. 3Read the binary, octal, decimal, hex and custom-base results and click Copy
  4. 4For another base, enter any number from 2 to 36 in Custom base

FAQ

How large a number can it convert? Does it lose precision?
There is no digit limit. The tool works digit by digit with BigInt: 2^64 − 1 (18446744073709551615) converts to hex ffffffffffffffff, and 2^128 − 1 (the size of a UUID or IPv6 address) converts to the 39-digit decimal 340282366920938463463374607431768211455, both exact (tested). Ordinary JavaScript numbers and many calculators are only exact up to 2^53 (9007199254740992); beyond that they go wrong, e.g. parseInt turns 18446744073709551615 into the incorrect hex 10000000000000000.
What do the 0x, 0b and 0o prefixes mean?
They mark the base in source code: 0x is hexadecimal, 0b binary and 0o octal (C also uses a leading 0 for octal). Paste 0xFF while Decimal is selected and the tool switches to hex with a note, giving 255; -0x1F is read as -31. In hex mode, though, the b in 0b1 is itself a digit, so it is read as hex B1 = 177 rather than as a binary prefix.
What are some common values in each base?
A few handy references you can check here: 255 = 0xFF = 0o377 = 0b11111111 (the largest byte); 65535 = 0xFFFF (two bytes); 2147483647 = 0x7FFFFFFF (the largest signed 32-bit integer); 4294967295 = 0xFFFFFFFF, which is 32 ones in binary; Linux file mode 755 is octal for binary 111 101 101, the read/write/execute bits for owner, group and others; and 0xDEADBEEF is 3735928559 in decimal.
How are negative numbers handled? Can I see two's complement?
Negative numbers are converted as a minus sign plus the absolute value, so -255 in hex is -ff, the mathematical notation. In memory, programs store negatives as two's complement, which depends on bit width: -1 is 0xFF in 8 bits and 0xFFFFFFFF in 32 bits. The tool does not show two's complement by width yet; to work it out, add the negative number to 2^n for an n-bit value, e.g. for 32-bit -1 that is 4294967296 − 1 = 4294967295, then convert to hex.
What is base 36 for? Does letter case matter?
Base 36 uses 0–9 plus 26 letters, the largest base that needs only digits and letters, so it is popular for shortening long numbers into short links or IDs: 18446744073709551615 is just the 13 characters 3w5e11264sgsf in base 36, and one billion is gjdgxs. Input is case-insensitive (FF equals ff), and results use lowercase letters.
Are decimals supported?
Integers only. Fractions often become infinitely repeating in another base: decimal 0.1 is 0.000110011… repeating forever in binary, which is why 0.1 + 0.2 is not exactly 0.3 in code. A decimal point is reported as invalid. Also, 1,5 is not read as 15: commas are removed only when they form groups of three digits (1,000,000).
Are my files or data uploaded?
No. Everything runs locally in your browser with no network upload, and is discarded when you close the page.
Do I need to sign up or pay?
No. The site is completely free, needs no account and has no usage limits.

Features

  • Binary, octal, decimal and hex at once, plus any base 2–36
  • Detects 0x, 0b and 0o prefixes and switches the input base, including with a minus sign
  • Accepts spaces, underscores, thousands commas and apostrophes as separators
  • BigInt arithmetic keeps huge integers exact
  • Instant messages when a prefix conflicts with the chosen base or a digit is out of range
  • Computed locally in real time, no network needed