Number Base Converter
The Number Base Converter turns a whole number into binary, octal, decimal, and hexadecimal at the same time. Type in any field and the rest update instantly — perfect for programming, digital electronics, networking, and computer-science homework. Every value here is read using positional (place-value) notation: each digit's contribution is the digit itself times the base raised to its position, counting from 0 on the right — decimal 42 is 4×10¹ + 2×10⁰, and its binary form 101010 is 1×2⁵ + 0×2⁴ + 1×2³ + 0×2² + 1×2¹ + 0×2⁰, both summing to the same value. The converter derives each target representation with the standard divide-and-remainder method: repeatedly dividing by the target base and reading the remainders from last to first. Hexadecimal reuses six extra symbols (A–F) to pack the remainders 10–15 into a single digit, which is why it represents the same value in far fewer characters than binary.
Type a whole number in any field — the others convert instantly.
Converts whole numbers between binary, octal, decimal, and hexadecimal. Everything runs in your browser — nothing is uploaded. Values are limited to safe integers (up to 9,007,199,254,740,991).
How This Tool Works
Type a whole number into any field — binary, octal, decimal, or hexadecimal — and the other three convert instantly. Copy any result with one click.
Formula & Method
Each value is read as an integer in its own base (binary is base 2, octal base 8, decimal base 10, hexadecimal base 16) and re-expressed in the others by repeatedly dividing by the target base and reading the remainders.
Example Calculation
Enter 255 in the Decimal field: Binary shows 11111111 (255 = 128+64+32+16+8+4+2+1, every bit set), Octal shows 377 (255÷8 = 31 r7, 31÷8 = 3 r7, 3÷8 = 0 r3, read bottom-up), and Hexadecimal shows FF (255 = 15×16 + 15, with each 15 rendered as the digit F).
About the Number Base Converter
Computers store everything as patterns of on and off, but people read numbers in tens, so moving between bases is a daily chore for anyone near code, networks, or electronics. This converter shows one whole number in four positional systems at once: binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). Type into any of the four fields and the other three redraw instantly, so you can start from whichever form you have in front of you, such as a hex color or a file permission, and read off the rest.
All four systems work the same way: each digit is multiplied by the base raised to the digit's position, counted from zero at the right, and the products are added. Decimal 493 is 4x100 + 9x10 + 3x1, and binary 111101101 is 1x256 + 1x128 + 1x64 + 1x32 + 0x16 + 1x8 + 1x4 + 0x2 + 1x1, which also equals 493. The bases that are powers of two are popular because they line up with bits: one hex digit is exactly four bits, so a byte is always two hex digits, and one octal digit is exactly three bits.
Students use it to check homework, web developers to read color codes, system administrators to decode Unix file permissions, and electronics hobbyists to interpret register values or addresses. The tool deals only in non-negative whole numbers up to JavaScript's safe-integer limit of 9,007,199,254,740,991, which covers nearly everyday uses and is spelled out in the sections below.
When to Use It
Decoding Unix file permissions
A system administrator sees chmod 755 and wants to be sure what it grants. Typing 755 into the Octal field shows binary 111101101, which splits into three groups: 111, 101, and 101. Read as read-write-execute flags, that means full access for the owner and read-plus-execute for group and others.
Reading web color codes
A designer is handed the color FF8800 and needs the red, green, and blue values for a design tool that uses 0 to 255. Entering each pair in the Hexadecimal field gives FF = 255, 88 = 136, and 00 = 0, so the color is RGB 255, 136, 0, a bright orange.
Understanding network addresses
A student learning IPv4 sees that 192.168.1.1 is four numbers from 0 to 255. Converting 192 to binary gives 11000000, showing why each part fits in exactly eight bits and why a subnet mask like 255 is eight ones. Hex C0 for the same value is how some tools print it.
Debugging low-level values
A developer reading a memory dump, an error code, or a hardware register sees 0x1F4 in documentation. Typing 1F4 into the Hexadecimal field reveals 500 in Decimal and 111110100 in Binary, which makes it easy to see which individual bits are set.
How to Use It, Step by Step
- Decide which form of the number you already have: binary, octal, decimal, or hexadecimal. The tool is two-way, so you can start from any field; you do not need to pick a source and target.
- Click the matching field, labeled Binary (base 2), Octal (base 8), Decimal (base 10), or Hexadecimal (base 16). The tool starts with the decimal value 42 filled in, so select the existing text and replace it.
- Type or paste the digits only: 0 and 1 for binary, 0 to 7 for octal, 0 to 9 for decimal, and 0 to 9 plus A to F for hexadecimal. Upper and lower case letters are both accepted in the hex field.
- Watch the other three fields update with each keystroke. Hexadecimal results are always shown in capital letters, and leading zeros are not shown, so 0010 in binary appears as 10.
- If a red message appears, the character you just typed does not belong in that base, for example a 2 in the binary field. The field returns to the last valid value; retype using only allowed digits.
- Clear a field completely and all four become empty, which is a clean way to start over. A field with only spaces is treated as empty too.
- Press the Copy button beside the field you need. It reads "Copied" for a moment, and the digits are on your clipboard without any 0x or 0b prefix, so add one yourself if your programming language requires it.
Understanding Your Results
The four fields always describe the same quantity. If you enter decimal 1000, the other fields show 1111101000 in binary, 1750 in octal, and 3E8 in hexadecimal. A quick check is length: binary uses roughly 3.3 digits for every decimal digit, octal about 1.1 digits per decimal digit, and hexadecimal about 0.83. Binary should always be the longest string and hexadecimal the shortest, and a result that breaks that ordering means you have typed something unexpected.
Powers of two give a tidy sanity check. 1024 is 10000000000 in binary (a 1 followed by ten zeros), 400 in hex, and 2000 in octal. A value of the form 2^n minus 1 is all ones in binary, and every hex digit is F: 255 is FF and 4095 is FFF. If you are working with fixed widths, such as 8-bit bytes or 16-bit words, count the binary digits and pad with leading zeros yourself, since the tool drops them.
When the number is too large, the tool shows the message "Number is too large to convert precisely." Numbers up to 9,007,199,254,740,991 (binary: fifty-three ones, hexadecimal: 1FFFFFFFFFFFFF) convert exactly. Beyond that, decimal values cannot be represented exactly in a standard JavaScript number, so the tool refuses rather than show a wrong digit. For 64-bit identifiers or cryptographic values, use a tool that supports big integers.
More Worked Examples
Reading the permission code 755
Scenario: Type 755 into the Octal (base 8) field.
The Decimal field shows 493, the Binary field shows 111101101, and the Hexadecimal field shows 1ED. The binary digits split into 111, 101, and 101, one group of three bits for each octal digit, which is why Unix permission codes are written in octal. The first group, 111, means read, write, and execute for the owner. The next two, 101, mean read and execute but no write for group and others. The decimal 493 is the same number, but it hides this structure.
One IPv4 piece and a two-byte value
Scenario: Type 192 into Decimal, then separately C0A8 into Hexadecimal.
Entering 192 in Decimal gives 11000000 in Binary, 300 in Octal, and C0 in Hexadecimal. Those eight bits are the first part of a typical home network address. Now type C0A8 into the Hexadecimal field: Decimal shows 49320, Octal shows 140250, and Binary shows 1100000010101000, which is 11000000 followed by 10101000. Those two bytes, C0 and A8, are 192 and 168, the first two parts of 192.168.
Hitting the limits
Scenario: Type 9007199254740991 into Decimal, then 9007199254740992, then a 2 into Binary.
The first value is the largest the tool can convert exactly: it shows 53 ones in Binary, 377777777777777777 in Octal, and 1FFFFFFFFFFFFF in Hexadecimal. Typing 9007199254740992, one higher, produces the red message "Number is too large to convert precisely." Typing a 2 in the Binary field produces a message that 2 is not a valid binary number, and the field keeps its previous valid content. Neither error changes the values in the other fields.
Tips for Better Results
- Group binary digits in fours by eye when reading long results. Each group of four maps to exactly one hex digit, so 1111 1010 reads as FA, which makes mental conversion between binary and hex quick.
- Convert hex color pairs one at a time. Splitting FF8800 into FF, 88, and 00 and converting each pair gives the three RGB channel values from 0 to 255.
- For Unix permissions, enter each octal digit separately or all three together and read the binary: the three bits stand for read, write, and execute, and a 1 turns the permission on.
- When your language needs a prefix, add it after copying: 0x for hex, 0b for binary, and a leading 0 or 0o for octal, depending on the language. This tool copies bare digits so you can pick the right form.
- Pad binary results to a fixed width when working with bytes or words. The tool shows 101 rather than 00000101, so add leading zeros up to 8, 16, or 32 digits yourself.
- If you need to convert a fraction or a negative number, convert the whole-number parts separately and handle sign and fractional digits by hand, since this tool supports non-negative integers only.
Common Mistakes to Avoid
- Typing a prefix such as 0x or 0b into a field. The letter x is not a valid hex digit, so it is rejected, and 0b101 in the hex field is read as the plain hex number 0B101, not binary 101.
- Entering a decimal point or minus sign. The fields accept only digits for the chosen base, so fractions and negative numbers are not converted.
- Confusing hex digits with decimal ones, such as reading 10 in hexadecimal as ten. It is sixteen, because the left digit has a place value of 16.
- Forgetting that leading zeros disappear. If a protocol expects a full eight-bit byte, 00001111 and 1111 are the same number but not the same written length.
- Assuming an unlimited range. Beyond about 9 quadrillion, the tool stops, so 64-bit hash values or large database IDs cannot be converted here.
Assumptions and Limits
- The converter handles non-negative whole numbers only, from 0 up to 9,007,199,254,740,991 (2^53 minus 1), the largest integer JavaScript represents without rounding.
- Negative numbers are not converted, so two's complement notation, used by computers for signed values, is outside what this tool shows. A binary string like 11111111 is always read as 255 here, never as minus 1.
- Output uses the standard digit sets with no prefixes, no spaces, and no leading zeros. Hex letters are uppercase.
- For anything involving security keys, financial amounts, or hardware where a single wrong bit matters, double-check the result against the specification or a second tool.
Key Terms
- Base (radix)
- The number of distinct digits a positional system uses. Binary is base 2, octal base 8, decimal base 10, and hexadecimal base 16.
- Bit
- A single binary digit, 0 or 1. Eight bits make a byte, which can hold values from 0 to 255.
- Hexadecimal
- A base-16 system using the digits 0 to 9 and the letters A to F for ten to fifteen. Each hex digit stands for exactly four bits.
- Octal
- A base-8 system using digits 0 to 7. Each octal digit stands for three bits, which is why Unix permissions are written in it.
- Positional notation
- A way of writing numbers in which a digit's value depends on its position, equal to the digit times the base raised to the position count.
Frequently Asked Questions
How do I convert binary to decimal?+
Type your binary number (only 0s and 1s) into the Binary field — the Decimal field updates instantly with the converted value.
What number sizes are supported?+
Any non-negative whole number up to 9,007,199,254,740,991 (the largest integer JavaScript can represent exactly), which covers virtually all everyday and programming needs.
Does it handle decimals or negative numbers?+
This converter works with non-negative whole numbers. Fractions and negative values aren’t supported.
Why does hexadecimal use letters like A–F?+
Base 16 needs sixteen distinct digit symbols, but only 0–9 exist as single decimal digits. Hexadecimal borrows A, B, C, D, E, and F to represent the values 10 through 15 in a single character, which is why FF is what the converter shows for decimal 255 instead of a longer run of digits.
Can I convert a full 64-bit value?+
Not entirely. The converter is limited to JavaScript safe integers — up to 9,007,199,254,740,991 (2^53 − 1) — so it covers the vast majority of everyday and programming use cases, but it can't represent the full 64-bit range (up to roughly 1.8×10^19), which would require exact big-integer handling this tool doesn't do.
Why do programmers use hexadecimal instead of binary?+
Binary is what the hardware stores, but it is long and easy to misread. Because 16 is a power of two, each hex digit corresponds to exactly four bits, so any binary value can be shortened by a factor of four without losing information. A full byte such as 11111111 becomes FF, and a 32-bit address fits in eight characters instead of thirty-two, which is much easier to type and compare.
Where is octal still used today?+
Its most common modern use is Unix and Linux file permissions, where the commands chmod 644 and chmod 755 give each of three user classes a digit from 0 to 7. Each octal digit holds three bits, matching the three permissions of read, write, and execute. Octal also appears in some older computing documentation and in escape sequences for characters in certain programming languages.
Does it accept prefixes like 0x or 0b?+
No. Each field accepts only the digits valid in its own base. The x in 0xFF is not a hexadecimal digit, so the field shows an error, and the character is not accepted. Type just FF instead. A subtle trap is that 0b101 typed into the hex field is accepted, since 0, b, 1, and 5 are all valid hex digits, but it means 0B101 in hex, which is 45313, not binary 101.
Why did my leading zeros disappear?+
The tool converts your input to a number and then writes that number back out in each base, and a number has no memory of how many zeros were typed in front of it. Binary 00001111 therefore comes back as 1111. If you need a fixed width, such as eight bits for a byte, add zeros on the left yourself after copying the result.
How do I turn a hex color code into RGB numbers?+
Split the six-digit code into three pairs: the first is red, the second is green, and the third is blue. Type each pair into the Hexadecimal field and read the Decimal field. For example, FF8800 becomes FF = 255, 88 = 136, and 00 = 0, giving RGB 255, 136, 0. Three-digit shorthand like F80 doubles each digit first, so it means FF8800.
Found this useful? Share it
Help someone else out — or link to it from your own site.
Link to this tool
Writing about number base converter? Paste this on your site to link here.
<a href="https://everyfix.net/tools/number-base-converter/">Number Base Converter</a> by <a href="https://everyfix.net">EveryFix</a>Related Tools
JSON Formatter
Format, validate, and minify JSON instantly in your browser.
Use tool →Case Converter
Convert text to UPPERCASE, lowercase, Title, camelCase, and more.
Use tool →Percentage Calculator
Calculate percentages, percentage of a number, or percentage change.
Use tool →Age Calculator
Calculate your exact age in years, months, and days.
Use tool →