Hex to Octal Converter

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

  1. Paste your hex values into the input (left).
  2. Use one number per line.
  3. Copy the octal results from the output (right).

Signed values are supported:

  • -1A-32
  • +FF377

Input rules (hex)

Allowed characters

Hex input may contain:

  • digits 0–9
  • letters A–F (or a–f)
  • an optional leading + or -

Examples:

  • 0
  • A
  • ff
  • 1A2B
  • -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_FF
  • 0xFF FF
  • DEAD_BEEF

Output format (octal)

  • Output uses digits 0–7
  • Negative values keep a leading -
  • No 0o prefix by default

Examples:

  • A12
  • 1020
  • FF377
  • 100010000
  • -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.

Frequently Asked Questions

Yes. Use a leading minus sign (−) or plus sign (+). The sign is preserved in the octal output.

Yes. This variant runs in batch mode by default: paste one hex integer per line and get one octal result per line.

Yes. Inputs like 0xFF, -0x1A, and +0x10 are accepted in this variant.

Yes. Spaces and underscores are ignored, so values like FF_FF or 0xFF FF work.

Octal is common in Unix-style permissions and some legacy systems. Converting helps when data is shown in hex but you need octal.

Try one of our format-specific converters below

Explore Our Tools

Read More From Our Blog