---
title: "Decimal to Binary Converter — Binary, Hex, Octal and Decimal | fbuff"
description: "Convert decimal to binary, binary to decimal, and hex or octal in one place. Type in any box and the other three update instantly, with step-by-step examples and a chart."
url: https://fbuff.com/tools/number-base/
---

# Number Base Converter

Developer

Convert numbers between binary, octal, decimal, and hexadecimal instantly.

![Four light bulbs, three lit and one off, above the number 13, showing 13 in decimal as 1101 in binary](https://fbuff.com/content/number-base.webp)

## How to use

1. Type a number into any of the four boxes: Binary, Octal, Decimal or Hexadecimal.
2. The other three update as you type. To convert the other way, type in another box, for example in Binary to get decimal.
3. A red message means a character does not belong to that base, such as a 2 in binary or a G in hex.

## How to convert decimal to binary by hand

Divide the number by 2 and write down the remainder (0 or 1). Keep dividing the result by 2 until you reach 0. The binary number is the remainders read from the last one to the first one.

Example with 13: 13 ÷ 2 = 6 remainder 1, 6 ÷ 2 = 3 remainder 0, 3 ÷ 2 = 1 remainder 1, 1 ÷ 2 = 0 remainder 1. Reading the remainders from the bottom up gives 1101, so 13 in decimal is 1101 in binary.

## How to convert binary to decimal

Each binary digit is worth twice as much as the digit to its right: 1, 2, 4, 8, 16, 32 and so on, starting from the right. Add up the values of the positions that hold a 1.

Example with 101101: the 1s sit in the 32, 8, 4 and 1 positions, and 32 + 8 + 4 + 1 = 45. So 101101 in binary is 45 in decimal.

## Decimal, binary, octal and hex chart (0 to 16)

Hexadecimal uses the letters A to F for the values 10 to 15. One hex digit always stands for exactly four binary digits, which is why programmers use hex as a short way to write binary: 1111 1111 is FF, and FF is 255.

| Decimal | Binary | Octal | Hex |
| --- | --- | --- | --- |
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 3 | 11 | 3 | 3 |
| 4 | 100 | 4 | 4 |
| 5 | 101 | 5 | 5 |
| 6 | 110 | 6 | 6 |
| 7 | 111 | 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 |
| 16 | 10000 | 20 | 10 |

## Where you see these number systems

Binary is how computers store everything, from numbers to photos. Hexadecimal shows up in web colors (#FF8800 is 255 red, 136 green, 0 blue), MAC addresses and error codes. Octal is mostly used for Linux file permissions: chmod 755 means 111 101 101 in binary, which is read, write and execute for the owner and read and execute for everyone else.

## Frequently asked questions

### Can it convert very large numbers?

Yes. The converter uses JavaScript BigInt, so it handles whole numbers with hundreds of digits exactly, with no rounding. Many calculators lose accuracy above 9,007,199,254,740,991.

### Can it convert decimal fractions like 0.5 to binary?

Not yet. It converts whole numbers only. To convert a fraction by hand, multiply the part after the point by 2 and write down the digit before the point each time: 0.625 × 2 = 1.25 (1), 0.25 × 2 = 0.5 (0), 0.5 × 2 = 1.0 (1), so 0.625 is 0.101 in binary.

### How are negative numbers shown?

With a minus sign, for example -13 becomes -1101. Computers usually store negative numbers in two's complement instead, where the same value in 8 bits is 11110011. This tool does not produce two's complement output.

### Is hex case-sensitive?

No. You can type ff or FF; the result is always shown in capital letters.

### Does it work offline?

Yes. Every conversion runs in your browser, so once the page has loaded it works without an internet connection and nothing you type is sent anywhere.

Found a problem or have an idea? [Report a problem](https://fbuff.com/contact/?tool=number-base)

Share

## You might also like

- - [GUID / UUID Generator Generate UUIDs and convert GUIDs to short GUIDs locally in your browser.](https://fbuff.com/tools/guid-uuid-generator/)
- - [JSON Path Finder Inspect JSON, copy exact JSONPath expressions, and test paths locally.](https://fbuff.com/tools/json-path-finder/)
- - [URL Encoder Decoder Encode and decode URL components locally in your browser.](https://fbuff.com/tools/url-encoder-decoder/)
- - [Base64 Encoder Decoder Encode and decode Base64 text locally in your browser.](https://fbuff.com/tools/base64-encoder-decoder/)
- - [Unix Timestamp Converter Convert Unix epoch to datetime and back. 100% client-side.](https://fbuff.com/tools/unix-timestamp/)
- - [Color Picker Pick any color and copy HEX, RGB, and HSL values instantly.](https://fbuff.com/tools/color-picker/)
- - [JSON Formatter Format, prettify and validate JSON instantly. Minify in one click.](https://fbuff.com/tools/json-formatter/)
- - [Cron Job Parser Parse full crontab lines with commands, explain the schedule, and preview the next 5 runs.](https://fbuff.com/tools/cron-parser/)
- - [HTML Previewer Write or paste HTML and preview it live in a sandboxed iframe. Supports full pages and fragments.](https://fbuff.com/tools/html-previewer/)
- - [JWT Decoder Decode and inspect JWT tokens. View header, payload claims and expiry status instantly.](https://fbuff.com/tools/jwt-decoder/)
