Number Base Converter
Convert numbers between binary, octal, decimal, and hexadecimal online
Number Base Converter
0b11111111
0o377
255
0xFF
Bit representation
How to Use the Number Base Converter
Using the Number Base Converter is straightforward. The tool presents a single input field where you type the number you want to convert. You can enter a value in any of the four supported bases — simply select the corresponding input base using the selector or radio button group positioned next to or above the input field. By default the tool assumes decimal (base 10) input, so you can immediately type any positive whole number in the everyday format you already know. If you want to convert a hexadecimal value such as 1F or FF, switch the input base to hexadecimal first. Similarly, entering a binary string like 1011010 or an octal number like 177 requires selecting the appropriate base before you begin typing. Once you enter a value, the converter updates all output fields in real time — no button press is required. Four output fields display the equivalent in each of the four supported bases: binary, octal, decimal, and hexadecimal. Below those, three additional output fields show the number's 8-bit, 16-bit, and 32-bit unsigned binary representations, each zero-padded to the corresponding width. For example, entering the decimal value 255 produces a binary output of 11111111, an 8-bit representation of 11111111, a 16-bit representation of 0000000011111111, and a 32-bit representation of 00000000000000000000000011111111. Each output field includes a copy button that transfers that specific value to your clipboard with a single click — useful when you need to paste a hex address into a debugger, a binary sequence into a code comment, or a decimal value into a configuration file or spreadsheet. The tool only supports non-negative integers, since signed integers and floating-point numbers require different binary encoding schemes — two's complement and IEEE 754, respectively — that go beyond this converter's scope. If you enter a value larger than 4,294,967,295, the 32-bit representation overflows and the tool will indicate that the number exceeds the uint32 range. Fractional values are not supported; if you include a decimal point the non-integer portion will be ignored or rejected. A practical tip for hexadecimal input: the tool accepts values without a leading 0x prefix, and letters may be typed in either uppercase or lowercase (ff and FF produce identical results). This saves keystrokes when pasting values copied from a debugger, hex editor, or packet capture tool.
Number Base Reference Table
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 4 | 100 | 4 | 4 |
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 32 | 100000 | 40 | 20 |
| 64 | 1000000 | 100 | 40 |
| 127 | 1111111 | 177 | 7F |
| 128 | 10000000 | 200 | 80 |
| 255 | 11111111 | 377 | FF |
| 256 | 100000000 | 400 | 100 |
| 512 | 1000000000 | 1000 | 200 |
| 1024 | 10000000000 | 2000 | 400 |
| 65535 | 1111111111111111 | 177777 | FFFF |
| 4294967295 | 11111111111111111111111111111111 | 37777777777 | FFFFFFFF |
Why Convert Number Bases?
Developers and students who work regularly across multiple numeral systems know how tedious manual conversion can be. Converting a hexadecimal number to binary by hand requires memorizing that each hex digit maps to a four-bit group, carefully expanding each digit, and then checking your work. Doing the same in the opposite direction means grouping bits, looking up each octal or hex equivalent, and carefully tracking your position. Even with a scientific calculator, the process involves multiple mode switches and keystrokes, and a single miskeyed digit can send a debugging session in entirely the wrong direction. The Number Base Converter eliminates that friction. Because all conversions are performed instantly in the browser using client-side JavaScript, there is no server to contact, no account to create, and no data transmitted over the network. For developers working on proprietary systems, embedded firmware, or security-sensitive applications, this is particularly meaningful: the values you convert — whether memory addresses, cryptographic constants, binary protocol frame contents, or hardware register values — never leave your machine. This is a category of tool where privacy genuinely matters, and running entirely in the browser provides that guarantee without requiring any trust in a remote service. The inclusion of 8-bit, 16-bit, and 32-bit binary representations makes this tool especially valuable for bitwise work. When you need to design a bitmask, verify a bit flag, trace a shift operation, or understand why a bitwise AND of two values produces a specific result, seeing the full binary layout at the exact width your data type uses is far more instructive than having the raw binary digits alone. These fixed-width views directly mirror the mental model of CPU registers and primitive types in C, C++, Rust, and Go. Computer science and digital electronics students benefit greatly from having a zero-install, always-available tool for verifying homework problems, visualizing lecture examples, and exploring how values look across different bases. A student who sees that decimal 170 is 10101010 in 8-bit binary immediately grasps the concept of alternating bit patterns in a way that no textbook description alone can provide. Network engineers find the decimal-to-binary and binary-to-decimal paths useful for subnetting exercises and CIDR notation analysis. Front-end developers use the decimal-to-hex direction when working with color channel values. Security researchers expand hex values to binary to read binary protocols in packet captures. The tool covers all of these scenarios without installation, without waiting, and without any upload risk.
FAQ
What is binary numbering?
Binary (base 2) uses only digits 0 and 1. It is the fundamental number system of all computers because circuits have exactly two states: on (1) and off (0).
Why do developers use hexadecimal?
Hexadecimal (base 16) represents 4 bits per digit, making it much more compact than binary. A full byte (8 bits) can be expressed as just two hex digits, like FF for 255.
What is the difference between base 8 and base 16?
Octal (base 8) uses digits 0–7 and was common in older Unix systems for representing file permissions (like chmod 755). Hexadecimal (base 16) uses digits 0–9 plus letters A–F and dominates modern programming for colors, memory addresses, and binary values.
Does the tool support negative numbers?
The tool converts non-negative integers. Negative number representation varies by system (two's complement, sign-magnitude), so interpretation is left to your programming language and context.
Related Tools
What Are Number Bases?
The Number Base Converter on Yanapex is a browser-based utility that lets you instantly translate any non-negative integer across four foundational positional numeral systems: binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). Beyond simple conversion, it also computes and displays fixed-width binary representations of your number in three standard sizes — 8-bit, 16-bit, and 32-bit unsigned — so you can see exactly how that value would be stored in memory at each common data type width. Understanding why multiple bases exist requires stepping back to how computers work at the hardware level. Digital circuits operate on two voltage states — high and low — which map directly to binary digits: 1 and 0. Every integer stored in a computer is ultimately a binary number. A single binary digit is called a bit; eight bits form a byte, which is the smallest individually addressable unit of memory in virtually all modern processor architectures. Binary numbers grow long very quickly — the decimal value 1,023 requires ten binary digits (1111111111) — making them cumbersome to read and write by hand. Octal (base 8) groups binary digits in threes and was widely used in early computing environments. Hexadecimal (base 16), which extends the digit set with the letters A through F, groups binary digits in fours and is by far the most prevalent alternative base in modern programming. Hexadecimal appears constantly in practice: CSS and HTML color codes (#1A2B3C), memory dump addresses (0x00FFAA10), MAC addresses, Unicode code points (U+0041), SHA-256 and MD5 cryptographic hash digests, and raw packet inspection. The fixed-width binary representations displayed by this tool reflect how programming languages and hardware data types actually store numbers. A uint8 — an unsigned 8-bit integer — holds values from 0 to 255 and is shown as eight binary digits, zero-padded on the left. A uint16 spans 0 to 65,535 across sixteen bits. A uint32 spans 0 to 4,294,967,295 across thirty-two bits. These representations are essential for reasoning about bitwise AND, OR, XOR, and shift operations, as well as for constructing bitmasks, interpreting bit flags, and parsing low-level data formats. The tool serves back-end developers debugging serialized protocol data, embedded systems engineers reading hardware register contents, networking professionals verifying subnet masks, computer science students learning the fundamentals of number representation, and security researchers analyzing binary file formats and memory addresses.
How to Use the Number Base Converter
Using the Number Base Converter is straightforward. The tool presents a single input field where you type the number you want to convert. You can enter a value in any of the four supported bases — simply select the corresponding input base using the selector or radio button group positioned next to or above the input field. By default the tool assumes decimal (base 10) input, so you can immediately type any positive whole number in the everyday format you already know. If you want to convert a hexadecimal value such as 1F or FF, switch the input base to hexadecimal first. Similarly, entering a binary string like 1011010 or an octal number like 177 requires selecting the appropriate base before you begin typing. Once you enter a value, the converter updates all output fields in real time — no button press is required. Four output fields display the equivalent in each of the four supported bases: binary, octal, decimal, and hexadecimal. Below those, three additional output fields show the number's 8-bit, 16-bit, and 32-bit unsigned binary representations, each zero-padded to the corresponding width. For example, entering the decimal value 255 produces a binary output of 11111111, an 8-bit representation of 11111111, a 16-bit representation of 0000000011111111, and a 32-bit representation of 00000000000000000000000011111111. Each output field includes a copy button that transfers that specific value to your clipboard with a single click — useful when you need to paste a hex address into a debugger, a binary sequence into a code comment, or a decimal value into a configuration file or spreadsheet. The tool only supports non-negative integers, since signed integers and floating-point numbers require different binary encoding schemes — two's complement and IEEE 754, respectively — that go beyond this converter's scope. If you enter a value larger than 4,294,967,295, the 32-bit representation overflows and the tool will indicate that the number exceeds the uint32 range. Fractional values are not supported; if you include a decimal point the non-integer portion will be ignored or rejected. A practical tip for hexadecimal input: the tool accepts values without a leading 0x prefix, and letters may be typed in either uppercase or lowercase (ff and FF produce identical results). This saves keystrokes when pasting values copied from a debugger, hex editor, or packet capture tool.
Why Convert Number Bases?
Developers and students who work regularly across multiple numeral systems know how tedious manual conversion can be. Converting a hexadecimal number to binary by hand requires memorizing that each hex digit maps to a four-bit group, carefully expanding each digit, and then checking your work. Doing the same in the opposite direction means grouping bits, looking up each octal or hex equivalent, and carefully tracking your position. Even with a scientific calculator, the process involves multiple mode switches and keystrokes, and a single miskeyed digit can send a debugging session in entirely the wrong direction. The Number Base Converter eliminates that friction. Because all conversions are performed instantly in the browser using client-side JavaScript, there is no server to contact, no account to create, and no data transmitted over the network. For developers working on proprietary systems, embedded firmware, or security-sensitive applications, this is particularly meaningful: the values you convert — whether memory addresses, cryptographic constants, binary protocol frame contents, or hardware register values — never leave your machine. This is a category of tool where privacy genuinely matters, and running entirely in the browser provides that guarantee without requiring any trust in a remote service. The inclusion of 8-bit, 16-bit, and 32-bit binary representations makes this tool especially valuable for bitwise work. When you need to design a bitmask, verify a bit flag, trace a shift operation, or understand why a bitwise AND of two values produces a specific result, seeing the full binary layout at the exact width your data type uses is far more instructive than having the raw binary digits alone. These fixed-width views directly mirror the mental model of CPU registers and primitive types in C, C++, Rust, and Go. Computer science and digital electronics students benefit greatly from having a zero-install, always-available tool for verifying homework problems, visualizing lecture examples, and exploring how values look across different bases. A student who sees that decimal 170 is 10101010 in 8-bit binary immediately grasps the concept of alternating bit patterns in a way that no textbook description alone can provide. Network engineers find the decimal-to-binary and binary-to-decimal paths useful for subnetting exercises and CIDR notation analysis. Front-end developers use the decimal-to-hex direction when working with color channel values. Security researchers expand hex values to binary to read binary protocols in packet captures. The tool covers all of these scenarios without installation, without waiting, and without any upload risk.
Common Use Cases
The Number Base Converter serves a wide range of real-world workflows across engineering, education, and technology fields. A firmware engineer writing embedded C for a microcontroller needs to configure a hardware peripheral register by setting specific bits. The component datasheet specifies the register layout in binary, but the value must be written as a hexadecimal constant in source code. The developer types the binary bit pattern into the converter with binary selected as the input base and immediately reads the hexadecimal equivalent to paste into a define directive. A computer science student is completing an assignment on binary number systems. The exercise requires finding the 8-bit representation of several decimal values. Rather than expanding the conversion by hand and risking arithmetic errors, the student enters each decimal value and instantly verifies the zero-padded 8-bit binary output against their manual work before submitting. A network engineer is analyzing a raw packet captured from production traffic. A 32-bit field in the IPv4 header contains the value 0xC0A80001. The engineer enters this hexadecimal value into the converter and reads the decimal output (3,232,235,521) alongside the full binary expansion, making it straightforward to identify each individual byte of the IP address. A web developer is hand-coding a custom CSS color palette without a design application. A designer has specified a color channel as the decimal value 219 for the red component. The developer converts 219 from decimal to hexadecimal and gets DB, completing the six-character CSS hex color string in seconds. A security researcher is reverse-engineering a proprietary binary file format. The file header contains a four-byte magic number — 0x89 0x50 0x4E 0x47 in hexadecimal. The researcher converts each byte to binary individually to confirm the bit patterns match the PNG specification signature. An electronics hobbyist is programming an Arduino and needs to send a specific configuration byte over the SPI bus to a peripheral chip. The documentation lists the command byte as 11010010 in binary. A quick binary-to-hexadecimal conversion gives 0xD2, which the hobbyist uses directly in the SPI.transfer() call in their sketch. A student studying digital logic design is building a truth table for a 4-bit synchronous counter circuit. They use the converter to quickly verify the binary-to-decimal mapping for each count value from 0000 through 1111, confirming the sequence increments correctly from 0 to 15 without gaps or repeats. A database administrator is debugging a PostgreSQL table that stores integer bitmasks representing feature flag combinations. A query returns a suspicious integer value and the DBA needs to know which individual flags are set. Entering the decimal value into the converter and reading the 32-bit binary output reveals exactly which bit positions are active, without the need to write a helper script or open a programming environment.