Number Base Converter
Convert numbers between binary, octal, decimal, hexadecimal and any base from 2 to 36, including arbitrarily large integers.
Size & binary representation
- Bit length
- 8 bits
- Byte length
- 1 byte
- Signed width
- 9 bits
- Decimal digits
- 3
Two's complement (fixed width)
- 8-bit11111111Hex 0xFFSigned -1Unsigned 255
- 16-bit00000000 11111111Hex 0x00FFSigned 255Unsigned 255
- 32-bit00000000 00000000 00000000 11111111Hex 0x000000FFSigned 255Unsigned 255
- 64-bit00000000 00000000 00000000 00000000 00000000 00000000 00000000 11111111Hex 0x00000000000000FFSigned 255Unsigned 255
Negative numbers are shown as the bit pattern a CPU stores; values above the signed maximum show how the same bits read as a signed integer.
What is the Number Base Converter?
A number base (radix) is how many distinct digits a positional system uses. Decimal uses ten (0–9), binary two (0 and 1), octal eight (0–7) and hexadecimal sixteen (0–9 and A–F). Each hex digit maps to exactly four bits and each octal digit to three, which is why programmers use hex for memory addresses, colors and byte values, and octal for Unix file permissions.
This converter uses JavaScript BigInt, so it handles integers far beyond the 2⁵³ limit of regular numbers — 64-bit IDs, cryptographic values or numbers with tens of thousands of digits convert exactly, with no rounding. You can paste values the way they appear in code: prefixes such as 0x, 0b and 0o, a leading minus sign, and separators like 1_000_000, 1,000,000 or FF FF are all understood. Invalid digits are pointed out with their position instead of being silently ignored.
For low-level work, the details panel shows how many bits and bytes a value needs and its two's-complement encoding in 8, 16, 32 and 64 bits. That makes it easy to see that −1 is stored as 0xFF in a byte, or that the unsigned byte 200 reads as −56 when interpreted as a signed int8.
Frequently asked questions
- How do I convert binary to decimal by hand?
- Multiply each bit by its power of two and add the results, starting with 2⁰ at the rightmost bit. For 1011: 1×8 + 0×4 + 1×2 + 1×1 = 11.
- How are negative numbers represented in binary?
- Mathematically a negative number is just a minus sign plus the magnitude (−1010). Computers use two's complement in a fixed width instead: invert all bits of the magnitude and add one, so −6 in 8 bits is 11111010 (0xFA). The fixed-width table shows both readings of the same bits.
- What is the largest number I can convert?
- Up to 100,000 digits per field. Because the conversion uses BigInt, every digit is exact — unlike calculators built on floating-point numbers, which start rounding above 9,007,199,254,740,991.
- Which digits are used for bases above 10?
- Letters continue after 9: A = 10, B = 11, … up to Z = 35 in base 36. Input is case-insensitive, and the uppercase option controls how hex and custom-base results are displayed.
- Why does 0b1 in the hex field not mean binary?
- In hexadecimal, B is a valid digit, so 0b1 is the hex number 0B1 (177 decimal). Prefixes are only stripped when they match the field (0x for hex, 0b for binary, 0o for octal); in the decimal field any of the three prefixes is accepted and switches the base.
- Can I convert fractions like 0.1?
- No, this tool converts whole numbers only. Fractions such as decimal 0.1 have no finite binary representation, so they need a separate floating-point tool to show the rounding involved.
Related tools
- Base64 EncoderEncode and decode Base64 for text and files, with URL-safe mode, data URIs, file type detection and image preview. Fast, private and offline.
- Timestamp ConverterConvert Unix epoch timestamps (seconds or milliseconds) to human-readable dates in any time zone, and dates back to timestamps.
- JSON ⇄ CSVConvert JSON arrays to CSV and CSV back to JSON with custom delimiters, header detection, nested-field flattening and file download.
- YAML ⇄ JSONConvert YAML to JSON and JSON to YAML instantly with validation and clear error messages. Ideal for Kubernetes, Docker Compose and CI configs.
- CSS Unit ConverterConvert CSS units between px, rem, em, vw, vh and percentages with a configurable root font size and viewport.
- UUID / ULID GeneratorGenerate cryptographically random UUID v4, time-ordered UUID v7, ULID and Nano ID identifiers in bulk, and inspect or convert existing IDs — locally in your browser.