[{"data":1,"prerenderedAt":587},["ShallowReactive",2],{"guide-octal-number-system-explained":3},{"id":4,"title":5,"body":6,"date":577,"description":578,"extension":579,"meta":580,"navigation":581,"path":582,"readingTime":583,"seo":584,"stem":585,"__hash__":586},"guides\u002Fguides\u002Foctal-number-system-explained.md","Octal Number System Explained: Base-8 Basics",{"type":7,"value":8,"toc":554},"minimark",[9,14,18,21,25,30,33,104,112,122,126,136,197,207,211,214,283,286,292,295,301,304,308,312,315,321,325,328,334,338,342,348,390,393,397,400,404,407,411,479,482,486,517,521,542,546],[10,11,13],"h2",{"id":12},"what-is-the-octal-number-system","What Is the Octal Number System?",[15,16,17],"p",{},"The octal number system is a base-8 numeral system that uses eight digits: 0 through 7. Each position in an octal number represents a power of 8, just as each position in a decimal number represents a power of 10.",[15,19,20],{},"Octal emerged in computing because it provides a compact way to represent binary values. Every octal digit maps directly to exactly three binary digits (bits), making conversion between the two systems trivial.",[10,22,24],{"id":23},"how-octal-works","How Octal Works",[26,27,29],"h3",{"id":28},"place-values","Place Values",[15,31,32],{},"In octal, the rightmost digit represents 8⁰ (1), the next represents 8¹ (8), then 8² (64), and so on:",[34,35,36,61],"table",{},[37,38,39],"thead",{},[40,41,42,46,49,52,55,58],"tr",{},[43,44,45],"th",{},"Position",[43,47,48],{},"4",[43,50,51],{},"3",[43,53,54],{},"2",[43,56,57],{},"1",[43,59,60],{},"0",[62,63,64,85],"tbody",{},[40,65,66,70,73,76,79,82],{},[67,68,69],"td",{},"Power of 8",[67,71,72],{},"8⁴",[67,74,75],{},"8³",[67,77,78],{},"8²",[67,80,81],{},"8¹",[67,83,84],{},"8⁰",[40,86,87,90,93,96,99,102],{},[67,88,89],{},"Decimal value",[67,91,92],{},"4096",[67,94,95],{},"512",[67,97,98],{},"64",[67,100,101],{},"8",[67,103,57],{},[15,105,106,107,111],{},"The octal number ",[108,109,110],"code",{},"752"," converts to decimal as:",[113,114,119],"pre",{"className":115,"code":117,"language":118},[116],"language-text","7 × 64 + 5 × 8 + 2 × 1 = 448 + 40 + 2 = 490\n","text",[108,120,117],{"__ignoreMap":121},"",[26,123,125],{"id":124},"octal-prefix-convention","Octal Prefix Convention",[15,127,128,129,131,132,135],{},"In many programming languages, octal numbers are written with a leading ",[108,130,60],{}," or ",[108,133,134],{},"0o",":",[34,137,138,151],{},[37,139,140],{},[40,141,142,145,148],{},[43,143,144],{},"Language",[43,146,147],{},"Prefix",[43,149,150],{},"Example",[62,152,153,167,181],{},[40,154,155,158,162],{},[67,156,157],{},"C, Java, Python 2",[67,159,160],{},[108,161,60],{},[67,163,164],{},[108,165,166],{},"0755",[40,168,169,172,176],{},[67,170,171],{},"Python 3, JavaScript, Rust",[67,173,174],{},[108,175,134],{},[67,177,178],{},[108,179,180],{},"0o755",[40,182,183,186,191],{},[67,184,185],{},"Bash",[67,187,188,190],{},[108,189,60],{}," or none",[67,192,193,196],{},[108,194,195],{},"chmod 755"," implies octal",[15,198,199,200,202,203,206],{},"Python 3 dropped the bare ",[108,201,60],{}," prefix because it caused confusion — ",[108,204,205],{},"0123"," looked decimal but was actually octal.",[10,208,210],{"id":209},"converting-between-octal-and-binary","Converting Between Octal and Binary",[15,212,213],{},"This is where octal shines. Each octal digit maps to exactly three bits:",[34,215,216,230],{},[37,217,218],{},[40,219,220,223,226,228],{},[43,221,222],{},"Octal",[43,224,225],{},"Binary",[43,227,222],{},[43,229,225],{},[62,231,232,244,257,270],{},[40,233,234,236,239,241],{},[67,235,60],{},[67,237,238],{},"000",[67,240,48],{},[67,242,243],{},"100",[40,245,246,248,251,254],{},[67,247,57],{},[67,249,250],{},"001",[67,252,253],{},"5",[67,255,256],{},"101",[40,258,259,261,264,267],{},[67,260,54],{},[67,262,263],{},"010",[67,265,266],{},"6",[67,268,269],{},"110",[40,271,272,274,277,280],{},[67,273,51],{},[67,275,276],{},"011",[67,278,279],{},"7",[67,281,282],{},"111",[15,284,285],{},"To convert octal to binary, replace each digit with its 3-bit equivalent:",[113,287,290],{"className":288,"code":289,"language":118},[116],"Octal:  7   5   2\nBinary: 111 101 010\n",[108,291,289],{"__ignoreMap":121},[15,293,294],{},"To convert binary to octal, group bits from right to left in sets of three, then replace each group:",[113,296,299],{"className":297,"code":298,"language":118},[116],"Binary: 1 101 011\nPad:    001 101 011\nOctal:  1   5   3   → 153\n",[108,300,298],{"__ignoreMap":121},[15,302,303],{},"This one-to-three mapping is why octal was popular on systems with word sizes divisible by 3 — like the 12-bit PDP-8 and the 36-bit IBM 700 series.",[10,305,307],{"id":306},"converting-between-octal-and-decimal","Converting Between Octal and Decimal",[26,309,311],{"id":310},"octal-to-decimal","Octal to Decimal",[15,313,314],{},"Multiply each digit by its place value and sum:",[113,316,319],{"className":317,"code":318,"language":118},[116],"752₈ = 7×64 + 5×8 + 2×1 = 490₁₀\n",[108,320,318],{"__ignoreMap":121},[26,322,324],{"id":323},"decimal-to-octal","Decimal to Octal",[15,326,327],{},"Repeatedly divide by 8 and collect remainders:",[113,329,332],{"className":330,"code":331,"language":118},[116],"490 ÷ 8 = 61 remainder 2\n 61 ÷ 8 =  7 remainder 5\n  7 ÷ 8 =  0 remainder 7\nRead remainders bottom-up: 752₈\n",[108,333,331],{"__ignoreMap":121},[10,335,337],{"id":336},"where-octal-is-used-today","Where Octal Is Used Today",[26,339,341],{"id":340},"unix-file-permissions","Unix File Permissions",[15,343,344,345,347],{},"The most common modern use of octal is Unix file permissions. ",[108,346,195],{}," sets:",[34,349,350,362],{},[37,351,352],{},[40,353,354,357,359],{},[43,355,356],{},"Digit",[43,358,225],{},[43,360,361],{},"Meaning",[62,363,364,373,382],{},[40,365,366,368,370],{},[67,367,279],{},[67,369,282],{},[67,371,372],{},"Read + Write + Execute",[40,374,375,377,379],{},[67,376,253],{},[67,378,256],{},[67,380,381],{},"Read + Execute",[40,383,384,386,388],{},[67,385,253],{},[67,387,256],{},[67,389,381],{},[15,391,392],{},"Each digit represents owner, group, and others respectively.",[26,394,396],{"id":395},"embedded-systems","Embedded Systems",[15,398,399],{},"Some micro controllers use octal for memory addresses and register values, particularly 12-bit and 24-bit architectures where the bit grouping aligns naturally with octal digits.",[26,401,403],{"id":402},"legacy-systems","Legacy Systems",[15,405,406],{},"Older IBM mainframes and PDP minicomputers used octal as their primary notation. Some documentation and debugging tools still display values in octal for backward compatibility.",[10,408,410],{"id":409},"octal-vs-hexadecimal","Octal vs. Hexadecimal",[34,412,413,425],{},[37,414,415],{},[40,416,417,420,422],{},[43,418,419],{},"Property",[43,421,222],{},[43,423,424],{},"Hexadecimal",[62,426,427,437,448,457,468],{},[40,428,429,432,434],{},[67,430,431],{},"Base",[67,433,101],{},[67,435,436],{},"16",[40,438,439,442,445],{},[67,440,441],{},"Digits",[67,443,444],{},"0–7",[67,446,447],{},"0–9, A–F",[40,449,450,453,455],{},[67,451,452],{},"Bits per digit",[67,454,51],{},[67,456,48],{},[40,458,459,462,465],{},[67,460,461],{},"Word alignment",[67,463,464],{},"12, 24, 36 bits",[67,466,467],{},"8, 16, 32, 64 bits",[40,469,470,473,476],{},[67,471,472],{},"Modern usage",[67,474,475],{},"File permissions, legacy",[67,477,478],{},"Memory addresses, color codes",[15,480,481],{},"Hexadecimal dominates modern computing because modern word sizes (8, 16, 32, 64 bits) are multiples of 4, making hex the natural grouping. Octal persists in niches where its 3-bit grouping aligns better.",[10,483,485],{"id":484},"key-takeaways","Key Takeaways",[487,488,489,493,496,502,511,514],"ul",{},[490,491,492],"li",{},"Octal is base-8, using digits 0 through 7",[490,494,495],{},"Each octal digit maps to exactly three binary bits, making octal-binary conversion trivial",[490,497,498,499,501],{},"The most common modern use is Unix file permissions (",[108,500,195],{},")",[490,503,504,505,507,508,510],{},"Octal prefixes vary by language: ",[108,506,60],{}," in older languages, ",[108,509,134],{}," in modern ones",[490,512,513],{},"Hexadecimal has largely replaced octal because modern word sizes align with 4-bit grouping",[490,515,516],{},"Octal remains relevant on systems with word sizes divisible by 3",[10,518,520],{"id":519},"related-guides","Related Guides",[487,522,523,530,536],{},[490,524,525],{},[526,527,529],"a",{"href":528},"\u002Fguides\u002Fnumber-systems-explained","Number Systems Explained",[490,531,532],{},[526,533,535],{"href":534},"\u002Fguides\u002Fhexadecimal-guide","Hexadecimal Guide",[490,537,538],{},[526,539,541],{"href":540},"\u002Fguides\u002Fbinary-number-system","Binary Number System",[10,543,545],{"id":544},"try-it-yourself","Try It Yourself",[15,547,548,549,553],{},"Convert between octal, decimal, binary, and hexadecimal instantly with our free ",[526,550,552],{"href":551},"\u002Ftools\u002Fnumber-base","Number Base Converter",". Enter a value in any base and see all conversions at once.",{"title":121,"searchDepth":555,"depth":555,"links":556},2,[557,558,563,564,568,573,574,575,576],{"id":12,"depth":555,"text":13},{"id":23,"depth":555,"text":24,"children":559},[560,562],{"id":28,"depth":561,"text":29},3,{"id":124,"depth":561,"text":125},{"id":209,"depth":555,"text":210},{"id":306,"depth":555,"text":307,"children":565},[566,567],{"id":310,"depth":561,"text":311},{"id":323,"depth":561,"text":324},{"id":336,"depth":555,"text":337,"children":569},[570,571,572],{"id":340,"depth":561,"text":341},{"id":395,"depth":561,"text":396},{"id":402,"depth":561,"text":403},{"id":409,"depth":555,"text":410},{"id":484,"depth":555,"text":485},{"id":519,"depth":555,"text":520},{"id":544,"depth":555,"text":545},"2026-05-28","Understand the octal number system — how base-8 works, where it's used, and how to convert between octal, binary, and decimal.","md",{"immutable":581},true,"\u002Fguides\u002Foctal-number-system-explained",6,{"title":5,"description":578},"guides\u002Foctal-number-system-explained","dMSUnrBh1cX02GOU6h7X3qqIOXLoV4EIU8y0ST8GlV0",1780401335493]