Number Base Converter: Binary, Decimal, Hexadecimal and Octal
Convert numbers between binary, octal, decimal, hex and any base from 2 to 36. Handles fractions and huge numbers, and shows two's complement and float bits.
Type a number, choose the base it is written in and see it in decimal, hexadecimal, binary, octal and base 36. Whole numbers are exact at any size, fractions such as 0.1 are converted digit by digit, and the page also shows how computers store the number: two's complement for 8, 16, 32 and 64 bits and the IEEE 754 float and double layouts.
What it does
- Converts between any bases from 2 to 36, including fractions such as 0.1 or ff.8.
- Handles whole numbers far beyond 64 bits without losing digits.
- Shows two's complement for 8, 16, 32 and 64 bits, with the unsigned and signed readings.
- Shows the IEEE 754 float (32-bit) and double (64-bit) sign, exponent and fraction bits.
- Accepts a minus sign and the prefixes 0x, 0b and 0o, and ignores spaces, commas and underscores.
- Says how many bits the number needs.
Frequently asked questions
- Does it support fractions?
- Yes. Type a point, for example 0.1 or ff.8. Fractions are converted digit by digit. Some fractions never end in another base (0.1 in binary repeats), so the result is cut at 32 digits and marked as rounded.
- How are negative numbers shown?
- The main results use a minus sign. The two's complement table below shows how the same value is stored in 8, 16, 32 and 64 bits, for example -1 is FF in 8 bits. A value that does not fit a width is marked.
- What do the float and double rows mean?
- They show the bits a computer uses for the number in IEEE 754: 1 sign bit, then the exponent, then the fraction. If the width cannot hold the number exactly (0.1 cannot), the page tells you the value that is really stored.
- Why does it say a digit is not valid?
- Each base has its own digits. Binary only has 0 and 1, and octal stops at 7.
- Is anything sent to a server?
- No.
More tools
Code formatters
CSS beautifier CSS minifier HTML beautifier HTML minifier JavaScript beautifier JavaScript minifier JSON formatter YAML formatter XML formatter SQL formatter Markdown preview
Converters
Base64 encoder and decoder URL encoder and decoder Unix timestamp converter CSV to JSON JSON to CSV HTML entity encoder and decoder Time zone converter JSON to TypeScript XML to JSON HTML to Markdown Date difference calculator
Text tools
Regex tester Remove duplicate lines Lorem ipsum generator Word counter Case converter Text diff checker
Color and images
Color converter Contrast checker Image to Base64 Image resizer
Network
Subnet calculator Download time calculator Common ports list CIDR to IP range IPv6 address expander and compressor MAC address formatter curl command builder
Server and files
Cron expression explainer chmod calculator HTTP status codes
Encoding and security
Password generator UUID generator Hash generator JWT decoder QR code generator Password strength checker Wi-Fi QR code generator