Number System Converter

Free online number system converter. Convert between binary, decimal, hexadecimal, and octal in any direction with instant results. Built for programmers, students, and engineers.

Quick directions

Conversion settings

9 characters

Binary → Decimal

170

Every base at once

Binary1010 1010
Octal252
Decimal170
HexadecimalAA
Bit length4 of 8 bits set

Bit view — 8-bit pattern

17
06
15
04
13
02
11
00

Bit 0 is the least significant bit, on the right. Set bits: 1, 3, 5, 7 (value = 2^1 + 2^3 + 2^5 + 2^7).

How this converter works

  • • Arithmetic runs on BigInt, not float64, so values above 2^53 stay exact: FFFFFFFFFFFFFFFF converts to exactly 64 binary ones and 18446744073709551615 in decimal.
  • • Input is normalised before it is validated: the 0x, 0b, 0o and # prefixes, spaces, newlines, underscores and commas are all accepted. A prefix is only stripped when it matches the source base, because 0B1010 is also a valid hexadecimal number.
  • • Fractions expand digit by digit from an exact rational, so 0.1 in decimal shows as 0.0001100110… in binary — truncated at your chosen digit count, never rounded.
  • • Negatives are exact. Pick a bit width to see the two's complement pattern: −5 at 8 bits is 11111011 in binary, FB in hex and 373 in octal.
  • • Text mode encodes with UTF-8, so ASCII is one byte per character while é is two bytes (C3 A9) and an emoji is four.
  • • Everything runs in your browser via JavaScript — nothing you type is uploaded or logged. The URL keeps your chosen direction and value so the link is shareable.

About Number System Converter

A complete number system converter for binary (base-2), decimal (base-10), hexadecimal (base-16) and octal (base-8), plus any base from 2 to 36 in advanced mode. All twelve directions work — binary to decimal, decimal to binary, binary to hex, hex to binary, binary to octal, octal to binary, decimal to hex, hex to decimal, decimal to octal, octal to decimal, hex to octal and octal to hex — and each one has its own shareable link. The arithmetic runs on BigInt rather than float64, so a full 64-bit value such as FFFFFFFFFFFFFFFF converts to exactly 64 binary ones and 18446744073709551615 in decimal instead of losing its low bits. Input is normalised before it is validated, so 0x1F, 0b1010, 0o755, #FF, 1010 1010, 1_000_000 and multi-line pastes are all accepted. Beyond whole numbers it handles fractions by exact digit expansion, negative values as two's complement at 8, 16, 32 or 64 bits, leading-zero padding, digit grouping, a bit-level view of the current value, and text ↔ byte conversion in UTF-8.

Why use a Number System Converter?

Most online base converters are built on parseInt and Number.prototype.toString, which route every value through a 64-bit float. Above 2^53 that silently corrupts the result, so a u64 register dump, a 64-bit hash prefix or a pointer value comes back wrong — and most of them also reject the notation your value is actually written in, refusing 0x1F, 0b1010 and spaced byte groups. This converter fixes both: exact BigInt arithmetic with no upper bound, and tolerant parsing that strips prefixes, separators and whitespace before validating the digits. It then covers what a plain digit converter cannot express at all: signed values in two's complement, fractional values expanded exactly rather than rounded, per-byte text encoding in UTF-8, and a bit ruler that shows which powers of two are set.

Who is it for?

Software engineers working with bitwise operators, flags, and packed structs. Network engineers translating subnet masks between dotted-decimal and binary. Systems administrators reading or writing chmod-style octal Unix permissions. Embedded firmware developers reading datasheets that mix hex and binary. Front-end developers checking hex color values against their RGB equivalents. Reverse engineers and CTF players decoding memory dumps. Computer science students learning number systems, two's complement, and digital logic for the first time. Anyone preparing for technical interviews where binary, hex, and octal questions are common.

Number Systems Explained

Binary (base-2)

Digits: 0, 1

Binary is the native language of digital computers: every value is represented using only two digits, 0 and 1, where each position represents a power of two. The rightmost bit is 2^0 (1), the next is 2^1 (2), then 2^2 (4), 2^3 (8), and so on. An 8-bit byte can hold any value from 00000000 (0) to 11111111 (255). Binary maps directly to the on/off state of transistors and the logical operations AND, OR, XOR, and NOT, which is why every higher-level number system in computing ultimately reduces to it.

  • •Bit-level CPU operations and bitmasks
  • •Network subnet masks and CIDR notation
  • •File permission bits and feature flags
  • •Digital logic gates and circuit design
  • •Low-level firmware and assembly programming

Decimal (base-10)

Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

Decimal is the everyday human number system, using ten digits (0–9) and place values that are powers of ten. While computers do not natively store decimal, all input from users typically arrives as decimal text and must be parsed into binary before processing. Conversions between decimal and the computer-native bases (binary, hex, octal) are the most common use case for this tool, especially when reading numeric values out of code, configuration files, or hardware datasheets.

  • •Reading and writing numbers in source code
  • •Translating IPv4 octets in dotted-decimal form
  • •Configuration values, ports, timeouts, and limits
  • •Mathematical and statistical calculations
  • •User-facing output of any numeric quantity

Hexadecimal (base-16)

Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F

Hexadecimal uses sixteen distinct digits (0–9 and A–F) where A=10, B=11, C=12, D=13, E=14, F=15. Its key advantage is that each hex digit maps to exactly four binary bits, so a byte fits in exactly two hex characters and a 32-bit word fits in eight. This makes hex the standard format for memory addresses, machine code, hashes, MAC addresses, and CSS color codes. Reading a long binary string is error-prone for humans; the same value in hex is typically four times shorter and easier to scan.

  • •Memory addresses and pointer values in debuggers
  • •CSS and HTML color codes (#RRGGBB)
  • •MAC addresses and unique device identifiers
  • •Cryptographic hash digests (SHA-256, MD5)
  • •Binary file dumps and hex editors

Octal (base-8)

Digits: 0, 1, 2, 3, 4, 5, 6, 7

Octal uses eight digits (0–7), with each octal digit representing three binary bits. Once dominant in early computing, octal is now mostly seen in two places: Unix file permissions (chmod 755, 644) where each octal digit packs the read/write/execute bits for owner/group/other, and certain legacy systems and embedded environments. Many programming languages let you write octal literals using a leading 0 (e.g., 0755 in C) or 0o (0o755 in modern JavaScript and Python).

  • •Unix and Linux file permissions (chmod)
  • •Legacy mainframe and embedded systems
  • •Some hardware register documentation
  • •Octal escape sequences in strings
  • •Compact representation of 3-bit grouped data

How to use the tool

1

Pick a direction from the quick-direction chips — binary to decimal, hex to binary, octal to hex and the nine other pairs — or set the From and To bases yourself.

2

Paste or type the value. Prefixes (0x, 0b, 0o, #), spaces, newlines, underscores and commas are all accepted, so 0xFF, 1010 1010 and 1_000_000 work as typed.

3

Read the result as you type: there is no Convert button, and the panel below shows the same value in binary, octal, decimal and hexadecimal at once.

4

For negative values, choose a bit width (8, 16, 32 or 64) and tick Signed to see and to parse two's complement — −5 at 8 bits is 11111011.

5

Tick Pad with leading zeros to fill the chosen width, and Group digits to split binary into nibbles, hex into byte pairs and decimal into thousands.

6

Enter a fractional value such as 0.1 and set the fraction-digit count to control how far a non-terminating expansion is shown; the output is truncated, never rounded.

7

Switch to the Text / ASCII tab to convert text to binary, hex, decimal or octal bytes (and back), choosing the byte separator that suits your target.

8

Copy the result, download it as a .txt file, or share the URL — the direction and value are kept in the query string.

Worked Conversion Examples

Convert 13 (decimal) to binary

  1. 1Divide 13 by 2: 6 remainder 1
  2. 2Divide 6 by 2: 3 remainder 0
  3. 3Divide 3 by 2: 1 remainder 1
  4. 4Divide 1 by 2: 0 remainder 1
  5. 5Read the remainders from bottom to top
Result:1101

Convert 1011 0110 (binary) to hex using 4-bit grouping

  1. 1Split the binary into 4-bit nibbles from the right: 1011 and 0110
  2. 2Convert each nibble to its hex digit independently
  3. 31011 = 8+0+2+1 = 11 = B
  4. 40110 = 0+4+2+0 = 6
  5. 5Concatenate the hex digits in the original order
Result:B6

Convert 755 (octal) to chmod permission bits

  1. 1Split the octal value digit by digit: 7, 5, 5
  2. 2Convert each digit to 3 binary bits: 7=111, 5=101, 5=101
  3. 3Group as owner/group/other: 111 (rwx), 101 (r-x), 101 (r-x)
  4. 4Translate r=read, w=write, x=execute
Result:rwxr-xr-x

Convert FF (hex) to decimal

  1. 1Identify each hex digit's value: F = 15, F = 15
  2. 2Multiply each by its place value: 15 × 16^1 = 240, 15 × 16^0 = 15
  3. 3Sum the products: 240 + 15
Result:255

Convert 192 (decimal) to binary for an IPv4 octet

  1. 1Find the largest power of two that fits in 192: 128 (2^7)
  2. 2Subtract: 192 − 128 = 64; the next bit is 64 (2^6)
  3. 3Subtract: 64 − 64 = 0; remaining bits are zero
  4. 4Pad to 8 bits for an IPv4 octet
Result:11000000

Convert 1A (hex) to octal via decimal pivot

  1. 1Hex 1A = 1×16 + 10 = 26 in decimal
  2. 2Divide 26 by 8: 3 remainder 2
  3. 3Divide 3 by 8: 0 remainder 3
  4. 4Read remainders bottom to top
Result:32

Key Features

Exact BigInt engine

Integers of any length convert exactly. FFFFFFFFFFFFFFFF becomes 64 binary ones and 18446744073709551615 in decimal, where float-based converters return a wrong 65-bit string.

Tolerant input parsing

Prefixes, separators and whitespace are stripped before the digits are validated. A prefix is only removed when it matches the source base, because 0B1010 is also a valid hexadecimal number.

Signed values and bit widths

Pick 8, 16, 32 or 64 bits and toggle signed mode to read and write two's complement: −5 at 8 bits is 11111011 in binary, FB in hex and 373 in octal.

Fractions, padding and grouping

Fractional values expand exactly to the digit count you choose, with leading-zero padding to the selected width and digit grouping by nibble, byte pair or thousands.

Bit view and all bases at once

A bit ruler highlights every set bit with its power-of-two index, while a side panel shows the current value in binary, octal, decimal and hexadecimal simultaneously.

Text ↔ bytes in UTF-8

Convert text to binary, hex, decimal or octal bytes and back, with the byte separator of your choice. ASCII stays one byte per character; accented letters and emoji expand to their real UTF-8 length.

Common Use Cases

Bitwise operations and flag packing

Scenario: You need to set or check a specific bit inside a packed integer flag, for example combining permission flags or hardware register bits.

✓ Convert decimal flag values to binary to see exactly which bits are set, then back to decimal or hex for use in code.

IPv4 subnet masks and CIDR

Scenario: You are reading a CIDR notation like /24 and need to translate it to a dotted-decimal subnet mask, or convert 255.255.255.0 to binary to count the prefix length.

✓ Each octet converts independently between decimal and 8-bit binary, making it trivial to count the leading 1-bits and validate masks.

Unix file permissions (chmod)

Scenario: You see chmod 755 in a Dockerfile or shell script and want to know exactly which read/write/execute bits are granted, or you have a permission string and need the octal equivalent.

✓ Each octal digit maps directly to three permission bits, so the converter shows the bit pattern instantly.

CSS and HTML color codes

Scenario: You have a hex color like #1A2B3C and need its component RGB values for a JavaScript animation or canvas API call.

✓ Convert each pair of hex digits to decimal independently to get the red, green, and blue channel values.

Memory addresses in debuggers

Scenario: A crash log shows a hex memory address like 0x7FFE3A2C and you need to compare it to a decimal offset from a different tool.

✓ Hex-to-decimal conversion lines up addresses across tools that print in different bases.

ASCII and Unicode code points

Scenario: You need to translate a hex Unicode code point (U+0041) to its decimal value (65) to use in a numeric character reference like A.

✓ Hex-to-decimal conversion gives the exact code point value for use in HTML entities or programming language escape sequences.

Why Choose This Tool

  • Exact BigInt arithmetic — 64-bit and 128-bit values convert without the float64 precision loss that breaks parseInt-based converters
  • Tolerant input: 0x, 0b, 0o and # prefixes, spaces, newlines, underscores and commas are normalised before validation
  • Two's complement support at 8, 16, 32 and 64 bits, in both directions
  • Exact fractional expansion — 0.1 decimal shows as 0.0001100110… in binary, truncated rather than rounded
  • Twelve shareable conversion directions in one URL, plus any base from 2 to 36 and a UTF-8 text ↔ bytes mode
  • Runs entirely client-side: no signup, no rate limit, no value leaves the browser

Frequently Asked Questions

How do I convert binary to decimal, hex or octal?

Pick a direction chip (or set the From and To bases), then type or paste the value — the result updates as you type, with no Convert button. Input is normalised before it is validated, so 0b1010, 0x1F, 0o755, #FF, 1010 1010 and 1_000_000 are all accepted as written. By hand the arithmetic is positional: binary 1101 = 1×8 + 1×4 + 0×2 + 1×1 = 13, and decimal to binary is repeated division by 2 reading the remainders bottom-up. Binary to hex is faster in nibbles: group the bits in fours from the right and convert each group to one hex digit, so 1011 0110 is B6.

What is 777 in binary code?

It depends which base 777 is written in, and both readings are one click apart here. As an octal value — the usual context, because chmod 777 is octal — 777 is 111111111 in binary: each octal digit expands to exactly three bits, and 7 is 111, so chmod 777 grants read, write and execute to owner, group and other. As a decimal value, 777 is 1100001001 in binary (1010 in hex, 1411 in octal). Select Octal → Binary for the permission reading, or Decimal → Binary for the plain number.

How do I say "hi" in binary?

"hi" is 01101000 01101001. Open the Text / ASCII tab, keep the direction on Text → bytes, choose Binary notation, and type the word: h is code point 104 (01101000) and i is 105 (01101001), each padded to a full 8-bit byte. The same tab decodes in the other direction, so pasting 01001000 01100101 01101100 01101100 01101111 00100001 returns "Hello!". Encoding is UTF-8, which is identical to ASCII for the first 128 characters but correctly expands beyond them: é is two bytes (C3 A9) and an emoji is four.

How large a number can it handle, and is my input sent anywhere?

There is no practical size limit: the engine uses BigInt, so a 64-bit value such as FFFFFFFFFFFFFFFF converts to exactly 64 binary ones and 18446744073709551615 in decimal, and a 128-bit hex value converts exactly too. Converters built on parseInt and toString(2) run everything through a float64 and lose every bit below 2^53, which is why they return a wrong 65-digit string for the same input. Nothing you type is uploaded: the conversion runs in your browser, and the only thing that leaves the page is the value you deliberately put in a shared URL. Verify in DevTools' Network tab — zero requests while converting.

Can I convert negative numbers?

Yes. In decimal a negative is shown sign-magnitude (−5), but binary, octal and hex have no sign character, so a negative needs a fixed width and two's complement. Choose 8, 16, 32 or 64 bits and tick Signed: −5 at 8 bits is 11111011 in binary, FB in hex and 373 in octal, and −1 at 32 bits is FFFFFFFF. Parsing works the same way in reverse — with signed mode on at 8 bits, 11111011 reads back as −5, while with signed mode off the identical pattern is the unsigned 251. That ambiguity is exactly why the width and the signedness must be stated alongside any bit pattern.

What is this useful for day to day?

Reading Unix permissions (octal 755 = 111 101 101 = rwxr-xr-x), checking subnet masks (255.255.255.0 is 11111111 11111111 11111111 00000000, a /24 prefix — the subnet calculator does whole CIDR blocks), decoding bitmask flags to see which bits a packed integer sets, lining up a hex memory address from a crash log against a decimal offset, splitting a #1A2B3C colour into its 26/43/60 RGB channels, and translating a U+0041 code point to the decimal 65 an HTML numeric reference needs. The bit view makes the flag cases obvious: it lists every set bit as a power of two.

Why isn't 0.1 exact in binary?

Because 0.1 is 1/10, and 10 has the prime factor 5 while binary place values are only powers of 2 — so the expansion never terminates: 0.1 decimal is 0.000110011001100… repeating in binary. This converter expands the fraction from an exact rational and truncates at the digit count you set, rather than rounding, so you can see the repeating pattern itself. It is also the reason 0.1 + 0.2 ≠ 0.3 in every IEEE 754 language. A fraction terminates in a target base only when its denominator's prime factors all divide that base, which is why 0.5 and 0.25 are exact in binary but 0.1 and 0.3 are not.

Why is hex uppercase, and what do the grouping and padding options do?

Uppercase A–F matches datasheets, hash digests and MAC addresses; tick Lowercase letters if your style guide (or a CSS colour) wants ff instead of FF. Group digits inserts a space every 4 binary digits, every 2 hex digits and every 3 decimal digits, which is how bytes and nibbles are read by eye — the Copy button always emits the ungrouped string so the value pastes straight into code. Pad with leading zeros fills the output to the selected bit width, turning 101 into 00000101 for an 8-bit register. For encoding work rather than base conversion, see the hex encoder/decoder and the Unicode encoder/decoder.

Related Tools

→Hex Encoder/Decoder
→Unicode Encoder/Decoder
→Subnet Calculator
→RGB to Hex
→Base64 Encoder/Decoder
→Epoch Converter

Share This Tool

Found this tool helpful? Share it with others who might benefit from it!

💡 Help others discover useful tools! Sharing helps us keep these tools free and accessible to everyone.

Support This Project

Buy Me a Coffee