GrowthGPT
GrowthGPT
AI community platform for modern work

Number Base Converter

Convert numbers between binary, octal, decimal, and hexadecimal in real time.

Input

Select the input base, then type your number.

Quick examples:

Binary (Base 2)

Enter a number above

Octal (Base 8)

Enter a number above

Decimal (Base 10)

Enter a number above

Hexadecimal (Base 16)

Enter a number above

About this tool

  • All conversions happen in your browser. No data is sent to any server.
  • Supports binary, octal, decimal, and hexadecimal number systems.
  • Binary output is grouped in 4-bit nibbles for readability.
  • Shows the ASCII character when the value falls in the printable range (32 to 126).

Understanding Binary Numbers

Binary is the foundational number system used by every digital computer. It uses only two digits, 0 and 1, to represent all values. Each digit is called a bit (short for binary digit), and bits are grouped into bytes (8 bits), nibbles (4 bits), and words (16, 32, or 64 bits depending on the processor architecture).

Binary matters because it maps directly to the on/off electrical states inside a CPU. When developers work with low-level code, embedded systems, networking protocols, or bitwise operations, reading and writing binary is essential. This converter groups binary output into 4-bit nibbles separated by spaces so you can quickly identify hex digit boundaries and spot patterns in bit fields.

Hexadecimal in Web Development

Hexadecimal (base 16) is the most common shorthand for binary data on the web. CSS colors like #FF5733 are hex-encoded RGB values. Memory addresses, hash digests (SHA-256, MD5), and UUIDs are all displayed in hex because it is more compact than binary while still aligning perfectly with byte boundaries: every two hex digits represent exactly one byte.

In JavaScript, hex literals are written with the 0x prefix, for example 0xFF equals 255 in decimal. This converter shows hex output in uppercase with an optional 0x prefix, matching the convention used in most programming languages, debuggers, and documentation.

Octal in Computing

Octal (base 8) uses digits 0 through 7. It was historically popular on systems with word sizes that were multiples of 3 bits, such as the PDP-8 and early UNIX machines. Today, octal is most commonly encountered in UNIX file permission notation. The permission string 755 means the owner can read, write, and execute (7), while the group and others can read and execute (5).

Octal literals in many programming languages start with a leading zero or the 0o prefix. Understanding how octal maps to binary (each octal digit represents exactly 3 bits) helps system administrators and developers interpret permission masks, umask values, and legacy codebases that use octal constants.

Number Bases in Programming

Most programming languages support multiple number base literals. JavaScript uses 0b for binary, 0o for octal, and 0x for hexadecimal. Python, C, Go, Rust, and many others follow similar conventions. Choosing the right base for a given context improves code readability.

Use binary when working with bit flags, masks, and hardware registers where individual bit positions matter. Use hex when dealing with colors, memory addresses, cryptographic hashes, and protocol fields that align on byte boundaries. Use octal for UNIX permissions and legacy compatibility. Use decimal for human-facing values like counts, prices, and measurements. This converter helps you move between all four bases instantly so you can pick the format that makes your code clearest.

Frequently Asked Questions

How do I convert binary to decimal?

Each binary digit represents a power of 2, starting from the rightmost digit at 2^0. To convert manually, multiply each bit by its positional power of 2 and sum the results. For example, 1010 in binary equals (1 x 8) + (0 x 4) + (1 x 2) + (0 x 1) = 10 in decimal. This tool does the conversion instantly as you type.

What is hexadecimal used for?

Hexadecimal is used wherever compact representation of binary data is needed. Common uses include CSS color codes (#FF0000 for red), memory addresses in debuggers, SHA and MD5 hash outputs, MAC addresses, IPv6 addresses, and encoding bytes in network protocols. Each hex digit maps to exactly 4 binary bits, making conversions between the two straightforward.

What is two's complement?

Two's complement is the standard method computers use to represent signed (positive and negative) integers in binary. The leftmost bit acts as the sign bit: 0 means positive, 1 means negative. To find the two's complement of a negative number, invert all bits of its positive form and add 1. For example, -5 in 8-bit two's complement is 11111011. This system allows addition and subtraction to use the same hardware circuitry.

Why is octal used for file permissions?

UNIX file permissions have three groups (owner, group, others) with three flags each (read, write, execute). Since 3 bits map perfectly to one octal digit, a single octal digit encodes all three permission flags for one group. The permission 755 means binary 111 101 101, giving the owner full access and read-plus-execute to everyone else. Octal makes these values compact and easy to read at a glance.

Does this tool store my data?

No. All number conversions happen entirely in your browser using JavaScript. Nothing you type is transmitted to any server, logged, or stored. Closing the tab discards everything. There are no accounts, no tracking, and no data collection.

Related Tools