Flip Caps

Text Tools

Text Case ConverterLetter & Character RemovalDuplicate Line RemoverDuplicate Word FinderEm Dash RemoverDash RemoverFind and Replace TextSentence CounterRemove Line BreaksRemove Text FormattingRemove UnderscoresReverse Text GeneratorAlphabetical OrderEmail ExtractorURL ExtractorUpside Down TextAdd Commas to NumbersRemove EmojisBold Text GeneratorItalic Text GeneratorSlug GeneratorLorem Ipsum GeneratorText RepeaterRemove AI FormattingView all

PDF Tools

Merge PDFSplit PDFExtract PDF PagesPDF to JPGPDF to PNGAdd WatermarkAdd Page NumbersHeader & FooterTable of ContentsRemove Blank PagesView all

Converters

CM to InchesMM to InchesMeters to FeetKM to MilesCM to FeetInches to FeetMeters to YardsInches to CMInches to MMFeet to MetersView all 34 converters

Image Tools

PNG to JPG ConverterJPG to PNG ConverterWebP to JPG ConverterWebP to PNG ConverterPNG to WebP ConverterJPG to WebP ConverterImage ResizerImage CompressorCrop ImageRotate ImageWatermark ImageMeme GeneratorPhoto EditorFavicon GeneratorAdd Logo to ImageRemove EXIF DataView all

Calculators

Age CalculatorPercentage CalculatorDiscount CalculatorTip CalculatorScientific CalculatorCompound Interest CalculatorLoan CalculatorMortgage CalculatorSavings Goal CalculatorBMI CalculatorCalorie CalculatorPregnancy Due Date CalculatorIdeal Weight CalculatorGPA CalculatorGrade CalculatorHours Worked CalculatorDate Difference CalculatorDays Until CalculatorRoman Numeral ConverterFraction CalculatorRatio CalculatorAverage CalculatorRetirement CalculatorDebt Payoff CalculatorBody Fat CalculatorOvulation CalculatorBlood Alcohol CalculatorFuel Cost CalculatorUnit Price CalculatorBudget Planner (50/30/20)Monthly Expense CalculatorPaycheck CalculatorTax Refund EstimatorView all

Fun & Random

Spin the WheelDice RollerCoin FlipperRandom Quote GeneratorRandom Number GeneratorYes or No GeneratorKeyboard TesterDead Pixel TesterCamera Shutter Count CheckerRandom Team GeneratorChore WheelMagic 8-BallTyping Speed TestPros and Cons ListBaby Name GeneratorUsername GeneratorFantasy Name GeneratorBusiness Name GeneratorNew Year's Resolution TrackerView all

Design & Color

Color ConverterRandom Color GeneratorQR Code GeneratorColor Palette GeneratorView all

Time & Word Tools

Word UnscramblerJumble SolverAlarm ClockOnline TimerStopwatchTime Zone ConverterSleep CalculatorHoliday CountdownView all
← Blog|Math

Binary, Decimal, and Hexadecimal: How Number Systems Actually Work

June 15, 2026|7 min read

Every number you see on a screen is being translated behind the scenes. A file size, a hex color code, a MAC address, an HTTP error code - your computer is showing you a translation of something it actually stores as a long string of 1s and 0s. Decimal, the base-10 system you learned in school, is built around having ten fingers. Computers do not have fingers. They have switches that are either on or off, which is why everything inside a computer ultimately comes down to binary. Hexadecimal sits in between as a convenient shorthand that humans and machines both find easy to work with. Once you understand how these three systems relate to each other, a lot of things that look like gibberish - hex color codes, file sizes, error codes - suddenly make sense.

Binary, decimal, and hexadecimal number systems explained side by side

Why Computers Count in Twos

The decimal system you use every day is a positional system: each digit's value depends on its position, and each position is worth ten times the position to its right. The number 247 means 2 hundreds, 4 tens, and 7 ones, or (2 x 100) + (4 x 10) + (7 x 1). Binary works exactly the same way, except each position is worth twice the position to its right instead of ten times. Binary only has two digits, 0 and 1, called bits.

How binary place value works with bits, nibbles, and bytes

To convert decimal 13 to binary, find which powers of 2 add up to 13. The powers of 2 are 1, 2, 4, 8, 16, 32, and so on. Since 13 = 8 + 4 + 1, the binary form is 1101: one 8, one 4, zero 2s, and one 1. That is why computers love binary. A transistor that is either carrying voltage or not maps perfectly onto a 1 or a 0, and a whole number can be built from a row of these switches. Group eight bits together and you get a byte, which can represent 256 different values from 0 through 255. Four bits is called a nibble, half a byte, and that is the key to understanding hexadecimal.

This matters more than it might seem. Whenever you see a spec sheet listing 8GB of memory, or a processor described as 64-bit, that number describes how many bits the hardware can work with at once. A 64-bit processor can address vastly more memory and handle much larger numbers in a single operation than a 32-bit one. The bit in those specs is the exact same bit you just used to write 13 as 1101.

Hexadecimal: The Shortcut Hiding in Color Codes

Binary is great for computers but painful for humans. A single byte written in binary is eight characters long, like 11100101, and a longer value gets unwieldy fast. Hexadecimal, base 16, solves this. It uses sixteen digits: 0 through 9, then A through F to represent 10 through 15. The reason hex is so useful is that one hex digit represents exactly one nibble, or 4 bits, so two hex digits represent exactly one byte. That 11100101 in binary becomes a tidy E5 in hex.

Hexadecimal color codes explained with RGB byte pairs

This is exactly why colors on the web are written in hex. A color like #E65000, the orange used throughout this site, breaks down into three bytes: E6 for red, 50 for green, and 00 for blue. Each pair is a value from 00 to FF, or 0 to 255, giving 256 possible levels per channel and over 16 million possible colors total. If you have ever needed to go from a hex code to the RGB or HSL values a design tool asks for, you were doing a base conversion without necessarily realizing it.

Convert hex color codes to RGB and HSL, or go the other direction when you only have RGB values and need the hex code for CSS.

Try the Color Converter

How to Convert Between Number Systems

Converting decimal to binary by hand uses repeated division by 2: divide the number by 2, write down the remainder, then divide the quotient by 2 again, and keep going until you reach 0. Reading the remainders from bottom to top gives you the binary number. For example, 50 divided by 2 is 25 remainder 0, 25 divided by 2 is 12 remainder 1, 12 divided by 2 is 6 remainder 0, 6 divided by 2 is 3 remainder 0, 3 divided by 2 is 1 remainder 1, and 1 divided by 2 is 0 remainder 1. Reading bottom to top gives 110010, which is binary for 50.

Converting between decimal, binary, and hexadecimal number systems

Converting decimal to hex works the same way but with repeated division by 16, and any remainder above 9 becomes a letter, where 10 = A, 11 = B, and so on up to 15 = F. Going from binary to hex is the easiest conversion of all: split the binary number into groups of four bits starting from the right, and convert each group to its single hex digit. 110010 becomes 0011 0010, which is 3 and 2, or 32 in hex. Going the other direction, from hex back to decimal, works by multiplying each hex digit by its place value, a power of 16, and adding the results. The hex value 3F is (3 x 16) + (15 x 1), which is 48 + 15 = 63, the same logic as decimal place values, just with 16 as the base instead of 10. If you would rather skip the arithmetic, a scientific calculator can handle powers of 2 and 16 quickly, which makes it easy to check your work or jump straight to the answer when verifying a conversion by hand.

Where Binary and Hex Show Up in Everyday Technology

File sizes are the most common place people run into this without realizing it. A kilobyte is technically 1024 bytes, or 2 to the power of 10, in the binary definition that operating systems often use, but storage manufacturers and some software use the decimal definition of 1000 bytes. That is why a drive labeled 1TB might show up as roughly 931GB in your operating system. The manufacturer used 1,000,000,000,000 bytes, while the operating system is counting in multiples of 1024.

Binary and hexadecimal in file sizes, error codes, and network addresses

Hex shows up constantly once you start looking. MAC addresses, the unique identifier for a network device, are written as six pairs of hex digits, like 1A:2B:3C:4D:5E:6F. Error codes in Windows and many APIs are written in hex, like 0x80004005, because the underlying error value is easier to read as a compact hex number than as a long decimal one. IPv6 addresses, the newer replacement for the IPv4 addresses most people are used to, are also written entirely in hexadecimal, something like 2001:0db8:85a3:0000:0000:8a2e:0370:7334, because the addresses are 128 bits long and writing that out in binary or decimal would be far too unwieldy. Even Unix file permissions use a related system, octal, base 8, where each digit represents read, write, and execute permissions as a 3-bit group.

Convert between bytes, kilobytes, megabytes, gigabytes, and more, and see how the binary and decimal definitions of a kilobyte compare.

Try the Data Storage Converter

Base64: Turning Binary Data Into Text You Can Copy and Paste

Base64 is a different kind of number system trick. It is not really used for arithmetic, but for representing binary data using only printable text characters. Many systems, like email and older web protocols, were built to handle text safely but can corrupt raw binary data. Base64 solves this by taking the binary data, splitting it into 6-bit chunks instead of the usual 8-bit bytes, and mapping each 6-bit chunk to one of 64 characters: A through Z, a through z, 0 through 9, plus two more symbols, usually + and /.

This is why you will see base64 used to embed small images directly inside CSS or HTML files, attach files to emails, and pass binary tokens through APIs and URLs as plain text. It is worth being clear about what base64 is not: it is not encryption, and it provides no security on its own. Anyone can decode it back to the original data in seconds. If you need to encode text or binary data into base64, or decode a base64 string back to its original form, the Base64 Encoder handles both directions.

Common Mistakes and a Quick Reference

A few mix-ups come up again and again. The first is treating 1024 and 1000 as interchangeable when talking about file sizes. They are close enough to confuse people but different enough to explain a missing chunk of your hard drive's advertised capacity. The second is forgetting that hex digits represent fixed amounts: a single hex digit always covers 0 to 15, and two hex digits always cover 0 to 255, no matter what the value represents, whether it is a color channel, an error code, or a byte of data. The third is confusing bits and bytes. A 100 Mbps internet connection is 100 megabits per second, not megabytes, which is why that connection downloads at roughly 12.5 megabytes per second, not 100.

As a quick reference: binary uses digits 0 and 1, with place values that double, 1, 2, 4, 8, 16, 32, and so on. Hexadecimal uses digits 0 through 9 and A through F, with each digit worth a fixed power of 16, and two hex digits always equal one byte. Decimal is the base-10 system everyone already knows. Once you can move between these three systems, even just recognizing them on sight, color codes, file sizes, and error messages stop looking like noise and start looking like information you can actually use. The next time you copy a hex color code, check a file size, or paste a base64 string into a decoder, you will know exactly what is happening underneath, and why it looks the way it does.


← Back to all articles