Developer

Binary, Octal, Decimal and Hex: How Number Bases Work

Numbers can be written in many bases, and developers constantly switch between them: hexadecimal for colors and memory addresses, binary for flags and bitmasks, octal for file permissions, and decimal for everyday math. How positional number bases work, why very large values need exact arithmetic, and the hex and binary values you meet every day.

Awais 2 min readPublished
Binary, Octal, Decimal and Hex: How Number Bases Work

Numbers can be written in many bases, and developers constantly switch between them: hexadecimal for colors and memory addresses, binary for flags and bitmasks, octal for file permissions, and decimal for everyday math. The ToolOrbit Number Base Converter moves a value between binary, octal, decimal, and hexadecimal instantly, and it is BigInt-safe so huge numbers stay exact.

How positional bases work

Every base assigns place values as powers of that base. In base 10 the digit positions are ones, tens, hundreds. In base 2 they are ones, twos, fours, eights. Hexadecimal uses sixteen symbols, 0-9 then A-F, so a single hex digit packs four binary bits, which is why hex is such a convenient shorthand for binary data.

decimal 255
binary  11111111
octal   377
hex     FF

Why BigInt safety matters

  • JavaScript numbers lose precision above 2^53, silently corrupting large values
  • BigInt arithmetic keeps every digit exact, no matter how long the number is
  • This is essential for 64-bit IDs, cryptographic values, and large bit fields
  • The converter handles arbitrarily long inputs without rounding errors
Tip: When debugging bit flags, convert your decimal value to binary to see exactly which bits are set, then flip the ones you need and convert back.

Using the converter

Type a value into any base field and the others update at once. You do not need to add prefixes like 0x or 0b; just enter the digits for that base. All computation happens locally in your browser, so even large or sensitive values never leave your machine.

Common uses

Reach for the converter when decoding a hex color, reading a permission mode such as 755 in octal, inspecting a bitmask, or sanity-checking a memory address. Keeping a quick base converter at hand removes a whole category of off-by-one and place-value mistakes.

Hex and binary you meet daily

The nibble you keep bumping into
DecimalHexBinary
100xA1010
150xF1111
2550xFF11111111
40950xFFF111111111111

IPv6 addresses, MAC addresses, color values (#FF8800 is just hex), URL percent codes and git object names are all hex in disguise. Binary shows up in flags and bitmasks. Learn “0xF = 1111” and the pattern extends everywhere: 0xFF = 1111 1111, 0xFFF = three nibbles. That is the whole trick — you read hex one nibble at a time.

One more everyday use: CSS colors, MAC addresses and IPv6 literals are all hex, and git short hashes are hex in miniature. Converting a color like #6c7bff to decimal RGB (116, 123, 255) is the same three two-digit hex pairs you now recognize — the converter just does the pairing for you.


Tools mentioned

More reading

View all guides
Free Developer Tools Online: 2026 Developer Toolkit & Guides
Developer

Free Developer Tools Online: 2026 Developer Toolkit & Guides

Explore 30+ free browser-based developer tools: JSON formatters, Base64 converters, cron generators, regex testers, SQL formatters, and hash generators.

3 min readPublished
CSS Border Radius: 15 Copy-Paste Examples
Developer

CSS Border Radius: 15 Copy-Paste Examples

15 modern CSS border radius examples: rounded cards, pills, circle avatars, asymmetrical organic blobs, and fancy 8-value border radius shapes.

3 min readPublished
Percent Encoding Reference Table (Every Character)
Developer

Percent Encoding Reference Table (Every Character)

Complete percent encoding ASCII reference table: quick lookup for spaces, slashes, ampersands, punctuation, and UTF-8 special characters in URLs.

3 min readPublished
URL Encoding Explained: %20 vs +, Reserved Characters & Rules
Developer

URL Encoding Explained: %20 vs +, Reserved Characters & Rules

Complete guide to percent encoding in URLs: learn when to use %20 vs +, how reserved characters like & and ? work, and how to avoid encoding bugs.

3 min readPublished
Cron Every Hour, Day & Midnight: All Daily Schedules
Developer

Cron Every Hour, Day & Midnight: All Daily Schedules

Master standard daily cron schedules: cron every hour, every day at midnight, twice a day, and custom hourly intervals with copy-paste examples.

4 min readPublished
Cron Expression Cheat Sheet — Copy-Paste Schedule Examples
Developer

Cron Expression Cheat Sheet — Copy-Paste Schedule Examples

Free cron expression cheat sheet with copy-paste examples for every 5 minutes, hourly, daily at midnight, weekdays only, and more.

5 min readPublished
Cron Every 10 Minutes — Syntax, Examples and Best Practices
Developer

Cron Every 10 Minutes — Syntax, Examples and Best Practices

Use the cron expression */10 * * * * to run jobs every 10 minutes, plus examples for common schedules and troubleshooting tips.

3 min readPublished
Why CSV Is Tricky to Parse: Delimiters, Quotes and Headers
Developer

Why CSV Is Tricky to Parse: Delimiters, Quotes and Headers

Why CSV files are harder to read correctly than they look, how to choose the right JSON shape, and the mistakes to avoid.

2 min readPublished