Convert between binary, octal, decimal, hex and any base to 36 exactly at any size, with bitwise operations, IEEE-754 floats and an ASCII table.
Initializing in your browser…
Convert Unix timestamps to dates and dates to timestamps in any time zone, with seconds, milliseconds, microseconds and nanoseconds detected automatically.
Convert audio between MP3, M4A, WAV, FLAC, OGG and AAC in your browser, with a choice of quality, sample rate, channels and bit depth.
Encode and decode text, files and JSON as base64, base64url or hex as you type, with a check that every result decodes back exactly.
A crash dump shows a 64-bit register as 0xDEADBEEFCAFEBABE and you need its decimal value, plus what a 32-bit field would have kept of it.
Number, written in hex
DEADBEEFCAFEBABE
Converted
Decimal 16045690984503098046
Octal 0o1572555756771277535276
Binary 0b1101 1110 1010 1101 1011 1110 1110 1111
1100 1010 1111 1110 1011 1010 1011 1110
32-bit unsigned 3405691582 signed -889275714 * does not fit
64-bit unsigned 16045690984503098046 signed -2401053089206453570The value needs all 64 bits, far beyond the 53 bits an ordinary JavaScript number holds exactly, which is why a typical converter prints 16045690984503097000. Here the arithmetic is exact, so the decimal ends in ...098046. The top bit is set, so the same pattern read as a signed 64-bit integer is negative. A 32-bit field keeps only the low half, 0xCAFEBABE, which is 3405691582 unsigned or -889275714 as two's complement, and the row is starred because the high half was lost. 46 of the 64 bits are set.
Convert whole numbers and fractions between binary, octal, decimal, hexadecimal and any base from 2 to 36, plus base58, exactly at any size. Three more modes cover the rest of low-level number work: bitwise operations at a width you choose, a breakdown of how a value is stored as a 16, 32 or 64-bit floating-point number, and an ASCII table.
Most online converters use ordinary JavaScript numbers, which hold only 53 bits exactly. Anything larger is rounded without warning, so the largest 64-bit value, 18446744073709551615, comes back as 18446744073709552000. This tool does its arithmetic on arbitrary-precision integers, so a 64-bit register, a 128-bit identifier or a 200-digit number converts exactly, digit for digit.
Your input is checked against the base you choose before anything is converted. A digit that does not belong, such as a 2 in binary or a G in hexadecimal, produces an error that names the character and lists the digits the base uses, instead of quietly converting only the part before it. The 0x, 0b and 0o prefixes are accepted when they match the selected base; when they do not, the error offers to switch the base for you. Spaces and underscores between digits are ignored, so you can paste 1101 0110 or 0xFFFF_0000 as written.
Fractions work as well. 1.101 in binary is exactly 1.625 in decimal. Going the other way, 0.1 in decimal has no finite binary form, because a tenth cannot be built from halves, quarters and eighths; the tool shows 24 digits and says the expansion does not terminate, so you know the digits were cut off rather than finished. Negative numbers take a leading minus sign, and copying a negative hex value gives -0xFF rather than a malformed 0x-FF.
The fixed-width view shows how the value would sit in an 8, 16, 32, 64 or 128-bit integer, unsigned and as two's complement. A value that is too large is reduced the way hardware does it, by keeping the low bits, and the row is starred: 1000 stored in a byte becomes 232, or -24 when read as signed. Bitwise mode applies NOT, AND, OR, XOR, NAND, NOR, XNOR, logical and arithmetic shifts, and rotations at exactly the width you select, which matters because a browser console's own bitwise operators work at 32 bits only.
Float mode takes a decimal and shows exactly how IEEE-754 half, single or double precision stores it: the sign, exponent and mantissa bits, the hex pattern, and a formula that is correct for normal numbers, subnormals, zero, infinity and NaN. It then compares the stored value with the decimal you typed, digit by digit. Enter 0.1 and it tells you that even double precision holds a value with 55 decimal places, starting 0.10000000000000000555, about 5.551e-18 away. Everything runs in your browser.
Paste a 64-bit hex value and get its exact decimal value, its binary pattern in groups of four, and what it would read as in a 32-bit signed integer.
AND a status word with a mask, XOR two values to find the bits that differ, or rotate a hash state, all at 64 bits without a calculator that silently drops to 32.
Show a colleague why 0.1 + 0.2 is not 0.3 by putting 0.1 into Float mode and reading the value a double really holds.
Convert numeric IDs to base 36 or base58 for compact URLs and back again, exactly, however long the number is.
No practical one. The arithmetic uses arbitrary-precision integers, so the 64-bit maximum converts to exactly 18446744073709551615 and the 128-bit maximum to all 39 of its digits. Converters built on ordinary JavaScript numbers start rounding past 9007199254740991.
You get an error naming the character and listing the digits that base uses. If you typed a prefix such as 0x while another base is selected, the error offers to read the number in the base the prefix names.
Yes. Put a minus sign in front for a negative number; the fixed-width view then shows its two's complement form, so -1 is 255 in a byte. Fractions such as 1.101 in binary or 3.75 in decimal convert exactly when the result terminates, and are shown to 24 digits with a note when it does not.
A base used for Bitcoin addresses and many short IDs. It drops 0, O, I and l from the usual letters and digits so that no character can be mistaken for another when read aloud or copied by hand.
JavaScript's bitwise operators convert their operands to 32-bit integers first, so shifting 2^31 left by one gives 0 in the console. Bitwise mode here works at the width you select, so a 64-bit shift really is 64 bits.
Because a tenth has no finite binary form. Double precision stores the nearest value it can, which starts 0.10000000000000000555 and runs to 55 decimal places. The tool compares that with the decimal you typed, digit by digit, and shows the gap.
Yes. Values are rounded to the nearest representable half-precision number, with exact ties going to the one with an even last bit, which is the IEEE-754 default. Values from 65520 upward overflow to infinity.
Conversions run on your device in JavaScript. The values you enter are never sent over the network.