Number Base Converter
Convert between binary, octal, decimal and hexadecimal — or any base from 2 to 36 — in every field at once. Values are held as BigIntegers, so a 256-bit hash converts digit for digit instead of being rounded off. Nothing leaves your browser.
FF0Frequently asked questions
How do I convert binary to decimal?
Type or paste the binary digits into the Binary field. The decimal, octal and hexadecimal fields fill in as you type, so one conversion gives you all of them at once. It works the other way round too — every field is an input.
How do I convert decimal to hex?
Enter the number in the Decimal field and read the result from the Hexadecimal field. Use the copy button beside it to put the value on your clipboard, with or without digit grouping and in upper or lower case.
Can it convert numbers bigger than 64 bits?
Yes. Every value is held as a BigInt, so a 256-bit hash or a 2048-bit key converts digit for digit with no rounding. JavaScript numbers lose precision above 2^53, which is why parseInt-based converters quietly return the wrong decimal for long hex strings.
What do the 0x, 0b and 0o prefixes mean?
0x marks a hexadecimal literal, 0b a binary one and 0o an octal one, the same as in C, Python, Rust and JavaScript. You can paste a prefixed value into any field here and it is read in the base the prefix names, then shown in all the others.
Why will a field not accept some of the characters I type?
Each field only holds digits its own base is written in, so the binary field takes 0 and 1, the octal field 0 to 7, and the hexadecimal field 0-9 and A-F. Anything else is turned away as it is typed and the field says which character it refused, which means a value on screen is always a real number in that base. Spaces, underscores and commas are kept so a number pasted with separators still reads, and a 0x, 0b or 0o prefix switches the digits after it to the base the prefix names.
How are negative numbers handled?
A leading minus sign is kept through every base, so −255 shows as −FF in hex. The bit view and the width table show the two-s complement pattern that the value has in memory at 8, 16, 32, 64 and 128 bits, which is what a debugger or a hex dump would display.
Are the numbers I convert sent anywhere?
No. The conversion runs entirely in your browser with no network request of any kind, so values you paste here never reach a server, a log file or an analytics event.
