{
  "id": 13753020,
  "title": "Binary, Octal, Decimal, and Hexadecimal Explained (With Conversion Methods)",
  "url": "https://urgent.news/2026/10/11/binary-octal-decimal-and-hexadecimal-explained-with-conversion-methods",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-11T16:30:00.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/pulkitgovrani/binary-octal-decimal-and-hexadecimal-explained-with-conversion-methods-4b52"
  },
  "original_language": "en",
  "account": "Numbers are represented in base 10 due to our ten fingers. Computers use base 2, while programmers frequently employ base 8 and base 16 for compact binary representation. Understanding the pattern behind bases simplifies conversions.\n\nIn any base, each digit position holds a power of the base. For example, decimal 345 equals 3 x 100 + 4 x 10 + 5 x 1. Binary positions are powers of 2, so 1101 represents 1 x 8 + 1 x 4 + 0 x 2 + 1 x 1, equating to 13. There are four standard bases: binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16).\n\nBinary utilizes digits 0 and 1, mirroring hardware storage. Octal uses digits 0 to 7, common in Unix file permissions (chmod 755). Decimal employs digits 0 to 9 for everyday numbers. Hexadecimal blends digits 0 to 9 and letters A to F for colors, memory addresses, and byte values.\n\nTo convert decimal to another base, divide the number by the target base, record the remainder, and repeat until the quotient is 0. Read remainders from last to first. For example, 255 in hexadecimal: 255 ÷ 16 = 15 remainder 15, and 15 ÷ 16 = 0 remainder 15. Both remainders are F, so 255 is FF in hex.\n\nHexadecimal is prevalent because one hex digit equals four bits, making one byte always two hex digits. This explains color representation like #4338ca and the byte value 0xFF as 255. Binary-to-hex conversion involves grouping bits in fours. In code, binary is prefixed with 0b, octal with 0o, and hex with 0xFF. JavaScript's parseInt() parses hex, while toString(2) converts to binary. Python's int(), bin(), oct(), and hex() functions perform conversions.\n\nNegative numbers are stored in two's complement form, altering values based on sign. Use type checks when converting negatives. Hexadecimal's widespread use stems from its ability to compactly represent binary values.\n\nTo convert binary to decimal, sum the powers of 2 for each 1 bit. Binary 1101 equals 8 + 4 + 1 = 13. Hexadecimal is favored by programmers for its compact representation of binary data. 255 translates to 11111111 in binary and FF in hexadecimal. The chmod 755 command uses octal permission values: 7 for owner (read, write, execute) and 5 for group and others. Explore conversions with the free, browser-based Number Base Converter, available at ilovekit.app.",
  "summary": "We write numbers in base 10 because we have ten fingers. Computers work in base 2, and programmers often use base 8 and base 16 as compact ways to write binary. Once you see the pattern, conversions become straightforward. What a base means In any base, each digit position is worth a power of the base. In decimal, 345 means 3 x 100 + 4 x 10 + 5 x 1. In binary, each position is a power of 2, so…",
  "key_points": [
    "Decimal system based on ten fingers, computers use base 2",
    "Binary digits (0,1) represent hardware storage, octal (0-7) in Unix permissions",
    "Hexadecimal blends digits 0-9 and letters A-F, compact binary representation"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}