Convert Octal Numbers to Binary
How to convert octal 12 to binary (1010), why each octal digit maps to three bits, and how to keep base-converted values unambiguous when you copy or share them.
Converting octal to binary is one of the most predictable transformations you can apply to a value. It changes how a number is written, not what the number is. The short answer to the most common question: octal 12 is binary 1010, which is ten in decimal. The rest of this review explains why the conversion works, where it can go wrong, and what to watch for when the result leaves the place you created it.
Quick answer: octal 12 in binary
Each octal digit maps to exactly three binary digits. Octal 1 becomes 001 and octal 2 becomes 010. Joined together, that gives 001010. Dropping the leading zeros leaves 1010.
octal: 1 2
binary: 001 010
result: 001010 -> 1010 (binary)
check: 1×8 + 2 = 10 (decimal) = 8 + 2 = 1010 (binary)
A frequent mistake is treating the 12 as a decimal number. Decimal 12 is binary 1100, not 1010. If your source does not say which base the 12 is in, settle that before converting, because both answers are correct for different inputs.
Is this conversion suitable for my intended use?
For most purposes, yes. Octal-to-binary conversion is lossless and exact: no rounding, no approximation, and the original value can always be recovered. That makes it a safe transformation for reading Unix-style file permissions bit by bit, checking bit flags, teaching number systems, or debugging low-level data.
The decisive tradeoff is length versus legibility. Binary is about three times as long as octal and harder for people to scan or compare. Use binary when the individual bits matter. Keep octal, or use decimal, when people need to read, type, or compare the value quickly.
What does the conversion actually change?
Only the notation changes. The numeric value stays the same. This is different from text effects such as reversing or mirroring characters. Nothing is reordered, flipped, or swapped for look-alike Unicode symbols. Both input and output use ordinary digit characters.
The method works because 8 is 2 to the power of 3. Every octal digit, 0 through 7, therefore fits exactly into three bits, and you can convert one digit at a time without carrying anything between positions.
| Octal digit | Binary (3 bits) |
| 0 | 000 |
| 1 | 001 |
| 2 | 010 |
| 3 | 011 |
| 4 | 100 |
| 5 | 101 |
| 6 | 110 |
| 7 | 111 |
To convert any octal number, replace each digit with its three-bit group from the table, join the groups, and optionally remove leading zeros. Each example below has been checked against its decimal value.
- Octal 12 -> 001 010 -> 1010 (decimal 10)
- Octal 17 -> 001 111 -> 1111 (decimal 15)
- Octal 755 -> 111 101 101 -> 111101101 (decimal 493)
- Octal 40 -> 100 000 -> 100000 (decimal 32)
Going the other way, from binary to octal, uses the same table. Split the binary digits into groups of three starting from the right, pad the leftmost group with zeros if needed, and replace each group with its octal digit. For example, 1010 becomes 001 010, which is octal 12.
Octal uses only the digits 0 to 7. If the input contains an 8 or a 9, it is not a valid octal number, and any conversion result should be treated as an error rather than an answer.
Converting with code
If you convert values programmatically, Python's built-in functions handle both directions. The snippet below shows standard language behavior. It is not a test of any particular online converter.
value = int("12", 8) # parse "12" as octal -> 10
print(format(value, "b")) # 1010
print(bin(0o12)) # 0b1010
print(oct(0b1010)) # 0o12
Prefix conventions differ between languages, and this can cause silent errors. Python writes octal as 0o12 and binary as 0b1010. C and several related languages treat a plain leading zero, as in 012, as octal. Check how your environment parses prefixes before pasting values between languages.
Will the result stay readable and usable after copying or sharing?
Because the output is made of plain ASCII digits, it copies and pastes like any other text. It does not depend on special fonts, look-alike characters, or right-to-left display, so the typical problems of styled or mirrored text do not apply.
The real risks come from losing context about which base a value is in:
- Losing the base label. 1010 could be binary, decimal, or something else. Keep a prefix such as 0b, a subscript, or an explicit label like "binary" wherever the value is shared.
- Dropped leading zeros. Some applications treat a string of digits as a number and strip leading zeros. That breaks fixed-width bit fields such as 001010. Storing the value as text, or keeping a prefix, avoids this. Exact behavior depends on the application.
- Long strings. Long binary values are easy to mistype when copied by hand. Grouping digits into threes or fours, with spaces or underscores, improves readability. Remove the separators before feeding the value to software that does not accept them.
Accessibility is an open question. No screen-reader testing was supplied for this review, so it is unverified whether assistive technology announces a value like 1010 digit by digit or as a whole number. Either reading is plausible, and the two give a listener very different meanings. When the audience may rely on assistive technology, state the base in words and consider providing the decimal equivalent alongside the binary form.
When to keep plain octal or decimal instead
Prefer the original octal, or decimal, when readers mainly need the value rather than its bits. That includes most documentation, user-facing settings, and spoken or screen-read content. Switch to binary when you need to inspect, set, or explain individual bits, and include the base label so the result stays unambiguous wherever it travels.