Skip to content
ASCII World

Octal

What is Octal?

Octal (base-8) uses digits 0-7. Each octal digit represents exactly 3 bits, so a byte splits into a leading partial digit plus two full digits (or three digits for values up to 377 octal = 255 decimal). ASCII "A" is octal 101.

Octal is mostly seen in Unix file permissions (chmod 755 means rwxr-xr-x) and C/C++ string escapes (\101 is "A"). Watch out for a common bug: a leading zero in JavaScript or Python 2 triggers octal interpretation, so 010 evaluates to 8, not 10. Python 3 fixed this by requiring 0o10 for octal. Convert between octal and other bases with our octal-to-ASCII tool or the base converter.

References

Related Terms