How Computers Represent Numbers: Binary, Hex, and IEEE 754

A number is not the same thing as its written form. The quantity forty-five can appear as 45 in decimal, 101101 in binary, or 2D in hexadecimal without changing its value. Only the digit alphabet and the rule that assigns a weight to each position have changed.
Positional notation separated a value from its symbols
In the decimal number 472, the final digit means two units, the next one means seven tens, and the first means four hundreds. The same pattern works in any base b: moving from right to left, the positions weigh b⁰, b¹, b², and so on. Hexadecimal 2D therefore means 2 × 16 + 13, with D serving as the digit whose value is 13.
Positional notation did not appear once in a single place. Babylonian mathematics used sexagesimal place value, although for a long time it lacked an unambiguous mark for an empty position. Indian mathematics later combined decimal place value with zero as both a placeholder and a number. The notation passed to scholars in the Islamic world, while Fibonacci became one of its influential European advocates when he described the Indian digits and the zero sign in the 1202 Liber Abaci. The history is more complicated than “zero was invented in the fifth century”: an empty position, a zero symbol, and arithmetic with zero emerged at different times, as the University of St Andrews history of zero explains.
The great advantage of the notation lies not in base 10 but in a reusable rule that handles values of any size. Zero removes ambiguity from empty positions, and written algorithms can process addition or multiplication one place at a time. Replacing ten digits with two leaves the principle intact.
Binary arithmetic became practical when it met switching logic
In 1703, Gottfried Wilhelm Leibniz published Explication de l'Arithmétique Binaire, showing how to express and calculate with numbers using only 0 and 1. He was not the first person to notice binary patterns, but he supplied a systematic account of the arithmetic and connected it to a broader mathematical program.
The compact idea alone did not create a computer. A practical bridge appeared when logical operations were mapped to the states of switches. In his 1937 master's thesis, Claude Shannon applied Boolean algebra to relay and switching circuits, allowing circuit design to be reduced to formulas over two states.
The familiar explanation that “a transistor is on or off” captures the model but simplifies the physics. An actual device distinguishes voltage ranges, charge levels, magnetic states, or another stable carrier of information; the engineering abstraction then names the two states zero and one. Binary logic is useful because designers can leave a noise margin between the allowed ranges and compose complicated operations from repeatable elements.
Octal and hexadecimal make bit patterns readable to humans
A computer does not convert its data to hex before calculating. Octal and hexadecimal mostly help people because their bases are powers of two. One octal digit replaces exactly three bits, while one hexadecimal digit replaces four, so a binary string can be regrouped without arithmetic:
45₁₀ = 101101₂ = 55₈ = 2D₁₆
101 101 0010 1101
5 5 2 D
Octal was particularly convenient on machines whose word length was divisible by three. A DEC programming manual, for example, describes the 12-bit PDP-8 word as the range from 0000₈ through 7777₈, which takes four octal digits. Its legacy remains visible in Unix permissions, where each digit in 755 or 644 packs three read, write, and execute flags for one class of users.
Hex fits byte-addressed memory more naturally because two digits cover all 256 patterns of eight bits. Introduced in 1964, the IBM System/360 established the 8-bit byte across one compatible family of machines, while hexadecimal notation provided a manageable way to read addresses and memory dumps. The same relationship appears today in #RRGGBB colors, MAC addresses, Unicode code points, and hashes. Bases such as 32 or 36 solve a different problem: they do not map cleanly to whole groups of bits, but they can shorten integer identifiers by using digits and Latin letters.

A bit string does not say whether its value is positive or negative
Notation in a base describes a mathematical integer, while a machine word also needs conventions for width and signedness. The bits 11111111 mean 255 as an unsigned eight-bit value but −1 under two's complement. With n bits, two's complement covers −2^(n−1) through 2^(n−1)−1; negative values occupy the upper half of the bit patterns, allowing ordinary binary addition to operate on them as well.
Converting −45 to −2D is therefore not a view of a processor's internal representation. It is the same signed mathematical value written in another base. Producing a specific two's-complement pattern first requires a width such as 8, 16, 32, or 64 bits. Without that choice, the question has no unique answer.
IEEE 754 is not another base but a format for approximate numbers
Place-value integers work well for whole values, but very large, very small, and fractional quantities need something resembling scientific notation. Binary floating point expresses a number with a sign, a significand, and a power of two. The binary32 format stores one sign bit, eight biased-exponent bits, and 23 fraction bits; normal values have an implied leading one in the significand. Oracle's numerical computation guide shows the exact field layout.
A finite significand cannot represent every real number. Decimal 0.1 repeats forever in base 2, so binary32 and binary64 must round it. That behavior is not an implementation bug but a direct consequence of a finite format; What Every Computer Scientist Should Know About Floating-Point Arithmetic works through the binary expansion.
The first IEEE 754 standard was adopted in 1985 with William Kahan playing an instrumental role. The active IEEE 754-2019 standard specifies formats, operations, rounding, and exceptional conditions. Zeros, infinities, NaNs, and tiny subnormal numbers use special field combinations. The standard greatly reduced platform differences, but it does not promise that every numerical program will produce identical results after operations are reordered or intermediate precision changes.
Alphabetic numeral systems preserve value by different rules
Roman, Hebrew, and Greek numerals are useful reminders that not every written number is positional. Roman notation adds and sometimes subtracts symbol values; the familiar MCMLXXXIV means 1984, but historical inscriptions did not always follow the modern canonical form. The converter's limit of 3999 and its rejection of inputs such as IIII are therefore explicit tool conventions, not universal laws of Roman notation.
Hebrew notation also assigns values to letters, with geresh and gershayim helping mark a numeral. The combinations for 15 and 16 are traditionally reordered so that they do not form the letters of a divine name. The Greek Milesian system distributes letters among units, tens, and hundreds; Unicode describes the upper keraia as a numeral sign and the lower keraia before a letter as a thousands multiplier. Each notation can be mapped to an integer, but it does not share the generic base-conversion algorithm used by 101101, 45, and 2D.
What Number Base Converter actually does
Number Base Converter uses BigInt, so it converts arbitrarily large integers exactly between bases 2 through 36 and accepts a leading minus sign. Its binary, octal, decimal, hexadecimal, and custom-radix fields are bidirectional, with A–Z supplying digit values after 9. ECMAScript does define BigInt as an integer without a fixed bit width, so large values do not pass through the imprecise JavaScript Number type.
Separate fields convert canonical Roman numerals from 1 through 3999, Hebrew notation from 1 through 999,999, and Greek notation from 1 through 9999. Roman input is checked by converting it back to canonical form. Hebrew thousands have a documented ambiguity: a lone letter followed by a geresh is read as the smaller value when no remainder follows it.
The IEEE 754 panel parses the decimal input, rounds it to Float32, and displays 1 sign bit, 8 exponent bits, and 23 fraction bits, which the interface labels with the more familiar word mantissa. It does not convert fractions among bases, show binary64, or interpret negative integers as fixed-width two's-complement words. Every calculation runs locally in the browser, and the values entered are not sent anywhere.
Related tools
Frequently asked questions
What does the base of a numeral system mean?
The base determines the available digits and the weight of adjacent positions. In base b, each position to the left weighs b times as much as the previous one, so 2D in hexadecimal means 2 × 16 + 13, which is 45 in decimal.
Why do computers use binary?
Digital circuits are practical to build around two reliably distinguishable logical states. Those states can represent 0 and 1, while Boolean algebra describes operations on them. The physical device may encode them with voltage ranges, charge, magnetization, or another medium.
What is two's complement?
Two's complement interprets an n-bit word as a value from −2^(n−1) through 2^(n−1)−1 and lets the same binary adder handle positive and negative integers. For example, 11111111 is 255 when unsigned but −1 as an 8-bit two's-complement value. Bit width and signedness are essential to the interpretation.
Why can ordinary binary floating point not represent 0.1 exactly?
The fraction 1/10 has a factor of 5 in its denominator, so its base-2 expansion repeats forever. A floating-point format stores a finite number of significand bits and must round that expansion to a nearby representable value.
What are the limitations of Number Base Converter?
Its positional fields use BigInt and convert integers, not fractions, between bases. Negative values are displayed with a minus sign rather than as a fixed-width two's-complement word. The IEEE panel shows the fields of a rounded Float32 value, not a complete decoder for every IEEE 754 format.
Author
Alex RelFullstack Engineer
In commercial development since 2011 — over 15 years. Author of two SaaS products, TeleGo.io and LingvoHabit.com. The articles here come out of real client and product work.



