Binary Converter
Type a number in binary, octal, decimal or hex and see it in every other base at once, with the working shown. You also get its two’s complement form, and you can turn text into binary or hex and back. Big numbers stay exact.
How it converts
Two’s complement (signed)
Text to binary and back
Key facts
- Price
- Free, with no sign-up and no usage limits
- Privacy
- Runs in your browser: your files and text are never uploaded
- Works on
- Any current browser on Windows, macOS, Linux, ChromeOS, Android and iPhone
- Made by
- Toolgu
- Last updated
How to use the binary converter
- Type a number and choose its base: binary, octal, decimal, hex, or any base from 2 to 36. Prefixes like 0b, 0o and 0x and spaces between digit groups are fine.
- Every other base appears at once, grouped for easy reading, with a Copy button on each.
- See the working (place values, repeated division, or hex digits as groups of 4 bits) and the 8, 16, 32 and 64-bit two’s complement forms.
- Below, turn text into binary or hex bytes and back. Switching direction carries the output across.
Binary, octal, decimal and hex from 0 to 15
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 1 | 0001 | 1 | 1 |
| 2 | 0010 | 2 | 2 |
| 3 | 0011 | 3 | 3 |
| 4 | 0100 | 4 | 4 |
| 5 | 0101 | 5 | 5 |
| 6 | 0110 | 6 | 6 |
| 7 | 0111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 9 | 1001 | 11 | 9 |
| 10 | 1010 | 12 | A |
| 11 | 1011 | 13 | B |
| 12 | 1100 | 14 | C |
| 13 | 1101 | 15 | D |
| 14 | 1110 | 16 | E |
| 15 | 1111 | 17 | F |
Why computers use binary and hex
A computer stores everything as bits, each either 0 or 1. Eight bits make a byte, which holds 256 values (0–255). Hex is a short way to write bytes: each hex digit is exactly four bits, so one byte is always two hex digits, like FF for 255 or 0A for 10. That’s why hex appears in color codes (#FF8800), memory addresses, MAC addresses and file dumps. Octal groups bits in threes and survives mainly in Unix file permissions, such as chmod 755.
Fractions and negative numbers
Fractions convert too: binary 0.1 is one half, and 0.01 is one quarter. Some decimal fractions, like 0.1, repeat forever in binary, so the result stops after 20 digits with “…”. That is why 0.1 + 0.2 isn’t exactly 0.3 in most programming languages. Negative whole numbers are stored in two’s complement: in 8 bits, −5 is 11111011 (invert 00000101 and add 1).
For other encodings, see Base64 and URL encoding; to hash text, use the hash generator. Picking colors in hex? Try the color picker.
Frequently asked questions
How do I convert binary to decimal?
Multiply each bit by its place value (1, 2, 4, 8… from the right) and add them. 1011 = 1×8 + 0×4 + 1×2 + 1×1 = 11.
How do I convert decimal to binary?
Divide by 2 again and again, writing down each remainder, then read the remainders from the bottom up. 13 ÷ 2 = 6 r1, 6 ÷ 2 = 3 r0, 3 ÷ 2 = 1 r1, 1 ÷ 2 = 0 r1, so 13 is 1101.
How do I convert binary to hex?
Split the bits into groups of four from the right and replace each group with one hex digit (0–9, A–F). 1011 0110 is B6.
How is text turned into binary?
Each character is encoded as bytes using UTF-8, and each byte is written as 8 bits. “A” is 65, or 01000001; letters with accents and emoji take two to four bytes.
What is two’s complement?
The way computers store negative whole numbers. To negate a number, invert every bit and add 1. In 8 bits, −1 is 11111111 and −128 is 10000000.
Related tools
- JSON FormatterPretty-print, validate and minify JSON
- Base64 Encode / DecodeText and files to and from Base64
- URL Encode / DecodePercent-encode text and inspect URLs
- Hash GeneratorMD5, SHA-1, SHA-256 and SHA-512 for text and files
- JWT DecoderInspect header, payload, expiry and signature
- Regex TesterTest patterns with live match highlights
- Unix Timestamp ConverterEpoch time to dates and back
- Mic TestTest your microphone with a live level meter and playback