Convert hex to octal (base 16 → base 8)
Use this converter when you have hexadecimal integers (base 16) and need the octal representation (base 8).
This page is a focused Hex → Octal variant built for speed:
- Batch mode is enabled by default (one value per line)
- Controls are intentionally hidden to keep this variant fast and distraction-free
Need decimal/binary too, swapping, prefixes, or output formatting? Open the full Number Base Converter.
How to use it
- Paste your hex values into the input (left).
- Use one number per line.
- Copy the octal results from the output (right).
Signed values are supported:
-1A→-32+FF→377
Input rules (hex)
Allowed characters
Hex input may contain:
- digits
0–9 - letters
A–F(ora–f) - an optional leading
+or-
Examples:
0Aff1A2B-DEAD
Optional 0x prefix
You may paste values like:
0xFF-0x1A+0x10
Separators are ignored
Spaces and underscores are ignored, so these are valid:
FF_FF0xFF FFDEAD_BEEF
Output format (octal)
- Output uses digits
0–7 - Negative values keep a leading
- - No
0oprefix by default
Examples:
A→1210→20FF→3771000→10000-1A→-32
Intuition (binary bridge)
Hex and octal both map cleanly through binary:
- Hex digit = 4 bits
- Octal digit = 3 bits
So conversions often go hex → binary → octal conceptually. You don’t need to do that manually — this tool does it instantly — but it explains why the result sometimes changes length.
Batch example (one per line)
Input (hex):
A
0x10
FF
dead_beef
-1A
G1
Output (octal):
12
20
377
33653337357
-32
!ERROR: Hex input may contain only 0–9 and A–F
One invalid line won’t break the rest.
Common use cases
Unix permissions and masks
Octal is widely used for permission masks (like 755). If a system gives you a hex mask, converting to octal can make it easier to compare with chmod-style values.
Legacy systems
Some tools or environments still represent values in octal, while modern tooling often prints hex. Converting helps you align formats.
Learning number bases
Hex ↔ octal is a neat demonstration of how different bases relate through binary.
Troubleshooting
“Hex input may contain only 0–9 and A–F”
A line contains an invalid character (like G, Z, ., or commas).
Remove invalid characters, or switch bases in the full tool if your input is actually decimal/octal/binary.
“I expected a 0o prefix”
This focused variant outputs plain octal digits.
If you need a 0o prefix, add it yourself, or use the full tool if you decide to expose formatting controls there.
“My hex is two’s complement”
This page treats -1A as a signed string with a leading minus sign.
If you have fixed-width two’s complement values, you need the bit width to interpret negatives.
Notes
- This is number base conversion for integers, not text/byte encoding.
- Everything runs locally in your browser — nothing is uploaded.