Convert numbers between binary, octal, decimal and hex in your browser. Paste 255, 0xFF or 0b11111111 and get every base back, with no rounding.
Runs in your browser — your input is processed on this device and never uploaded.
Integer to convert. Optional leading + or -. Auto-detects 0x hex, 0b binary, 0o octal, otherwise decimal. Underscores allowed. Maximum 8 KiB and 2048 digits.
Results appear here.
The same integer can be written in binary (base 2), octal (base 8), decimal (base 10) or hexadecimal (base 16). Programmers paste 255, 0xFF or 0b11111111 and want the other forms without losing precision to a floating-point calculator.
Paste a value and this tool returns it in decimal, hex, octal and binary, plus the base it read, whether it was negative, and its bit length. Conversion runs in your browser.
Many calculators store a floating-point number. Large hex constants, 128-bit values and anything past 2^53 lose their low bits before you see them. This converter uses an arbitrary-precision integer, capped at 2048 digits, so the result is exactly the integer you pasted.
Prefix detection is there because people paste literals straight from code. If the digits do not fit the prefix, the tool refuses with an error instead of reading a different number.
bc, Python's int(x, base) and your language's own literals do the same job locally. This page saves you opening a terminal for one number.
Unix Timestamp Converter on ToolkitBay reads an integer as a point in time, not as digits in another base. Hex Encoder and Decoder, Base64 and Multibase encode byte sequences and keep leading zero bytes. Use those when the input is binary data, and this page when it is one number.
Do not use the hex output as the bytes of a buffer. A leading 00 byte disappears here on purpose.
C's leading-zero octal (077) is not detected. Only the 0o prefix means octal, so 077 is seventy-seven. That avoids the surprise where a zero-padded decimal turns into a different number.
Bases 11 through 36 use letters as digits, so base 36 runs from 0 to Z. With from base set to 16, ff works without the 0x prefix.
Bit length is the number of bits needed for the magnitude, not counting a sign bit. 255 needs 8 bits and 256 needs 9.
Conversion runs in your browser. The number is not sent to ToolkitBay's servers.
Find similar tools by category or tag.