Exact conversion between any bases on BigInt, with fixed-width integer views, bitwise algebra and IEEE-754
Initializing in your browser…
Convert between Unix timestamps and dates in any of 400+ time zones, in seconds, milliseconds, microseconds or nanoseconds
Convert between MP3, WAV, OGG, AAC, M4A and FLAC with a bitrate, sample rate, channel count and bit depth that all reach the encoder, and a panel that reports what was actually written.
Encode and decode text, files and JSON as base64, base64url or hex, checked by decoding the result back
A register dump gives you a 64-bit hex value and you need it in decimal, plus what it looks like masked into 32 bits.
Input
0xDEADBEEFCAFEBABE, base 16
Converted
Decimal 16045690984503098046 Binary 1101 1110 1010 1101 ... 1011 1110 Octal 1572555756771277535276 32-bit unsigned 3405691582 signed -889275714 *does not fit 64-bit unsigned 16045690984503098046 signed -2401053089206453570
Everything runs on BigInt, so the value is exact: a converter built on JavaScript numbers holds 53 bits and returns 16045690984503097000 instead. Fixed-width rows are produced by masking, so the 32-bit row shows the low half that storing it there would actually keep, starred because bits were discarded. Digits that do not belong to the base are rejected with the character named, rather than silently truncated the way parseInt truncates 1012 read as binary into 2.
Convert numbers between binary, octal, decimal, hexadecimal and any base from 2 to 36, plus base58 with the Bitcoin alphabet. Everything runs on BigInt, so a value is exact at any size: paste the 64-bit maximum and you get 18446744073709551615, not 18446744073709552000. A converter built on JavaScript numbers, which is what most of them are, holds only 53 bits exactly and silently rounds anything larger. Beyond conversion there are three more modes: a bitwise calculator that works at a width you choose up to 128 bits, an IEEE-754 inspector that handles subnormals, infinities and NaN properly, and an ASCII table. Together they make a small workbench for low-level work: memory addresses, register masks, protocol fields and floating-point surprises.
Base Converter parses your input in the base you select and rejects anything that is not a digit in it. That sounds obvious and is where most tools go wrong: `parseInt` stops at the first character it cannot use and returns what it had, so 1012 read as binary quietly becomes 2 and 12G read as hexadecimal becomes 18. Here each digit is checked first, and an input that does not belong to the base gets an error naming the offending character and listing the digits the base actually uses. The 0x, 0b and 0o prefixes are accepted when they match the selected base and rejected with an explanation when they do not, and underscores and spaces are accepted as group separators.
Fractional values work too. Enter 1.101 in binary and get 1.625 in decimal exactly; enter 0.1 in decimal and get 0.000110011... in binary, marked as non-terminating, because a fifth is not a sum of halves. The tool works out whether the expansion terminates in the target base rather than leaving you to wonder whether the digits ran out or the tool did.
Every value is also shown as a fixed-width integer at 8, 16, 32, 64 and 128 bits, unsigned and as two's complement. The reduction is a mask, not a subtraction: 1000 at 8 bits is 232 unsigned and -24 signed, which is what storing it in a byte would actually keep, rather than the 744 you get by subtracting 256 from anything over 127. A row that did not fit is starred, so you can see that bits were discarded rather than assuming the number survived.
Bitwise mode computes NOT, AND, OR, XOR, NAND, NOR, XNOR, logical and arithmetic shifts, and left and right rotations, at 8, 16, 32, 64 or 128 bits. JavaScript's own bitwise operators coerce their operands to 32 bits, so 2^31 shifted left comes out as 0 and any operand past 2^32 is silently a different number; everything here is BigInt at the stated width, so a 64-bit mask behaves like a 64-bit mask.
The IEEE-754 inspector decodes half, single and double precision. It reports which kind of value you have, and the formula it shows is true of that kind: a normal number has an implicit leading 1 and an exponent of e minus the bias, a subnormal has an implicit leading 0 and an exponent of 1 minus the bias, and infinity and NaN have no significand formula at all. Writing "1.mantissa x 2^(e - bias)" for every value, which is the usual shortcut, is wrong for zero, for every subnormal and for both infinities and every NaN. It also shows the value the format actually stores next to the value you typed, so entering 0.1 as a single tells you it is really 0.10000000149011612, about 1.49e-9 away. Quick buttons load pi, e, a third, infinity, NaN and the format's largest, smallest normal and smallest subnormal values.
The ASCII table covers 0 to 127 in decimal, hex, octal and binary, coloured by class, and a click copies the character. Everything runs locally in your browser.
There is no practical limit. Everything runs on BigInt, so the 64-bit maximum converts to exactly 18446744073709551615 and the 128-bit maximum to 340282366920938463463374607431768211455. A converter built on JavaScript numbers rounds anything past 9007199254740991.
Yes, any base from 2 to 36 using digits 0-9 and A-Z, and base58 with the Bitcoin alphabet, which leaves out 0, O, I and l so a digit cannot be misread.
You get an error naming the character and listing the digits the base uses. It is not silently truncated, which is what parseInt does: 1012 read as binary would otherwise give 2, because parsing stops at the 2 and returns what came before it.
Yes, with a leading minus. The fixed-width table then shows the two's complement pattern at each width, so -1 reads as 255 in a byte and 18446744073709551615 in a 64-bit word.
Yes. 1.101 in binary is 1.625 in decimal exactly. Where the expansion does not terminate, such as 0.1 in decimal converted to binary, the tool shows 24 digits and says the fraction does not terminate rather than leaving you to guess.
Because JavaScript bitwise operators coerce to 32 bits. In the console, 2 ** 31 << 1 is 0 and anything above 2^32 is truncated first. This tool works at the width you select, on BigInt, so a 64-bit operation is really 64 bits.
Conversions run on your device in JavaScript. The values you enter are never sent over the network.