HOME

TheInfoList




In
mathematics Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and their changes (cal ...
and
computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes and development of both computer hardware , hardware and software. It has sci ...

computing
, the hexadecimal (also base 16 or hex) numeral system is a
positional numeral system Positional notation (or place-value notation, or positional numeral system) usually denotes the extension to any radix, base of the Hindu–Arabic numeral system (or decimal, decimal system). More generally, a positional system is a numeral syste ...
that represents numbers using a
radix In a , the radix or base is the number of unique , including the digit zero, used to represent numbers. For example, for the decimal/denary system (the most common system in use today) the radix (base number) is ten, because it uses the ten digi ...

radix
(base) of 16. Unlike the
decimal The decimal numeral system A numeral system (or system of numeration) is a writing system A writing system is a method of visually representing verbal communication Communication (from Latin ''communicare'', meaning "to share") is t ...
system representing numbers using 10 symbols, hexadecimal uses 16 distinct symbols, most often the symbols "0"–"9" to represent values 0 to 9, and "A"–"F" (or alternatively "a"–"f") to represent values from 10 to 15. Hexadecimal numerals are widely used by computer system designers and programmers because they provide a human-friendly representation of
binary-coded
binary-coded
values. Each hexadecimal digit represents four
bit The bit is a basic unit of information in computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithm of an algorithm (Euclid's algo ...
s (binary digits), also known as a
nibble In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithm of an algorithm (Euclid's algorithm) for calculating the greatest c ...
(or nybble). For example, an 8-bit
byte The byte is a unit of digital information that most commonly consists of eight bit The bit is a basic unit of information in computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It ...
can have values ranging from 00000000 to 11111111 in binary form, which can be conveniently represented as 00 to FF in hexadecimal. In mathematics, a subscript is typically used to specify the base. For example, the decimal value would be expressed in hexadecimal as . In programming, a number of notations are used to denote hexadecimal numbers, usually involving a prefix. The prefix 0x is used in C which would denote this value as 0x. Hexadecimal is used in the transfer encoding Base16, in which each byte of the
plaintext In cryptography, plaintext usually means unencrypted information pending input into cryptographic algorithms, usually encryption In cryptography Cryptography, or cryptology (from grc, , translit=kryptós "hidden, secret"; and ''graphe ...
is broken into two 4-bit values and represented by two hexadecimal digits.


Representation


Written representation

In most current use cases the letters A–F or a–f represent the values 10–15, while the
numerals A numeral is a figure, symbol, or group of figures or symbols denoting a number. It may refer to: * Numeral system used in mathematics * Numeral (linguistics), a part of speech denoting numbers (e.g. ''one'' and ''first'' in English) * Numerical di ...

numerals
0–9 are used to represent their usual values. There is no universal convention to use lowercase or uppercase, so each is prevalent or preferred in particular environments by community standards or convention; even mixed case is used.
Seven-segment display A seven-segment display is a form of electronic display device s, LED display and Vacuum fluorescent display, VF display, top to bottom. A display device is an output device for presentation of information in visual or Touch, tactile form (the la ...
s use mixed-case AbCdEF to make digits that can be distinguished from each other. There is some standardization of using spaces (rather than commas or another punctuation mark) to separate hex values in a long list. For instance in the following
hex dump In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes and development of both computer hardware , hardware and softwa ...

hex dump
each 8-bit
byte The byte is a unit of digital information that most commonly consists of eight bit The bit is a basic unit of information in computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It ...
is a 2-digit hex number, with spaces between them, while the 32-bit offset at the start is an 8-digit hex number.
00000000 57 69 6b 69 70 65 64 69 61 2c 20 74 68 65 20 66 00000010 72 65 65 20 65 6e 63 79 63 6c 6f 70 65 64 69 61 00000020 20 74 68 61 74 20 61 6e 79 6f 6e 65 20 63 61 6e 00000030 20 65 64 69 74 0a


Distinguishing from decimal

In contexts where the
base Base or BASE may refer to: Brands and enterprises * Base (mobile telephony provider), a Belgian mobile telecommunications operator *Base CRM Base CRM (originally Future Simple or PipeJump) is an enterprise software company based in Mountain Vie ...

base
is not clear, hexadecimal numbers can be ambiguous and confused with numbers expressed in other bases. There are several conventions for expressing values unambiguously. A numerical subscript (itself written in decimal) can give the base explicitly: 15910 is decimal 159; 15916 is hexadecimal 159, which is equal to 34510. Some authors prefer a text subscript, such as 159decimal and 159hex, or 159d and 159h.
Donald Knuth Donald Ervin Knuth ( ; born January 10, 1938) is an American computer scientist A computer scientist is a person A person (plural people or persons) is a being that has certain capacities or attributes such as reason, morality, consciousnes ...
introduced the use of a particular typeface to represent a particular radix in his book ''The TeXbook''. Hexadecimal representations are written there in a typewriter typeface: In linear text systems, such as those used in most computer programming environments, a variety of methods have arisen: *
Unix Unix (; trademarked as UNIX) is a family of multitasking, multiuser Multi-user software is computer software Software is a collection of Instruction (computer science), instructions that tell a computer how to work. This is in contrast t ...
(and related) shells,
AT&T AT&T Inc. is an American multinational Multinational may refer to: * Multinational corporation, a corporate organization operating in multiple countries * Multinational force, a military body from multiple countries * Multinational state, a s ...
assembly language and likewise the
C programming language C (, as in the letter ''c'') is a general-purpose, procedural computer programming language A programming language is a formal language comprising a Instruction set architecture, set of instructions that produce various kinds of Input/outp ...
(and its syntactic descendants such as
C++ C++ () is a general-purpose programming language In computer software, a general-purpose programming language is a programming language dedicated to a general-purpose, designed to be used for writing software in a wide variety of application ...

C++
, C#, Go, D,
Java Java ( id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 147.7 million people, Java is the world's List of ...
,
JavaScript JavaScript (), often abbreviated JS, is a programming language A programming language is a formal language In mathematics Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), ma ...

JavaScript
,
Python PYTHON was a Cold War contingency plan of the Government of the United Kingdom, British Government for the continuity of government in the event of Nuclear warfare, nuclear war. Background Following the report of the Strath Committee in 1955, the ...
and
Windows PowerShell PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell (computing), shell and the associated scripting language. Initially a Windows component only, known as Windows PowerShell, it ...
) use the prefix 0x for numeric constants represented in hex: 0x5A3. Character and string constants may express character codes in hexadecimal with the prefix \x followed by two hex digits: '\x1B' represents the Esc control character; "\x1B _is_a_string_containing_11_characters_with_two_embedded_Esc_characters._To_output_an_integer_as_hexadecimal_with_the_printf.html" ;"title="m\x1B[25;1H" is a string containing 11 characters with two embedded Esc characters. To output an integer as hexadecimal with the printf">m\x1B[25;1H" is a string containing 11 characters with two embedded Esc characters. To output an integer as hexadecimal with the printf function family, the format conversion code %X or %x is used. * In URIs (including URLs), character encoding, character codes are written as hexadecimal pairs prefixed with %: http://www.example.com/name%20with%20spaces where %20 is the code for the space (blank) character,
ASCII ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the stu ...
code point 20 in hex, 32 in decimal. * In
XML Extensible Markup Language (XML) is a markup language #REDIRECT Markup language In computer text processing, a markup language is a system for annotation, annotating a document in a way that is Syntax (logic), syntactically distinguishable fro ...

XML
and
XHTML Extensible HyperText Markup Language (XHTML) is part of the family of XML Extensible Markup Language (XML) is a markup language #REDIRECT Markup language In computer text processing, a markup language is a system for annotation, annotating ...

XHTML
, characters can be expressed as hexadecimal
numeric character reference A numeric character reference (NCR) is a common markup (computer programming), markup construct used in SGML and SGML-derived markup languages such as HTML and XML. It consists of a short sequence of character (computing), characters that, in turn, ...
s using the notation &#x''code'';, for instance ’ represents the character U+2019 (the right single quotation mark). If there is no the number is decimal (thus ’ is the same character). * In the
Unicode Unicode, formally the Unicode Standard, is an information technology Technical standard, standard for the consistent character encoding, encoding, representation, and handling of Character (computing), text expressed in most of the world's wri ...

Unicode
standard, a character value is represented with U+ followed by the hex value, e.g. U+20AC is the
Euro sign The euro sign () is the currency sign A currency symbol or currency sign is a graphic symbol used as a shorthand for a currency's name, especially in reference to amounts of money. Usage When writing currency amounts, the location of the symb ...

Euro sign
(€). * Color references in HTML,
CSS #REDIRECT CSS #REDIRECT CSS Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation Introduction A presentation conveys information from a speaker to an audience. Presentations are typically demonst ...

CSS
and
X Window The X Window System (X11, or simply X) is a windowing system for bitmap displays, common on Unix-like operating systems. X provides the basic framework for a GUI environment: drawing and moving windows on the display device and interacting with ...
can be expressed with six hexadecimal digits (two each for the red, green and blue components, in that order) prefixed with #: white, for example, is represented as #FFFFFF. CSS also allows 3-hexdigit abbreviations with one hexdigit per component: #FA3 abbreviates #FFAA33 (a golden orange: ). * In
MIME #REDIRECT Mime artist A mime artist or just mime (from Greek , , "imitator, actor") is a person who uses mime as a theatrical medium or as a performance art Performance art is an artwork or art exhibition created through actions executed ...

MIME
(e-mail extensions)
quoted-printable Quoted-Printable, or QP encoding, is a binary-to-text encoding system using printable ASCII characters (alphanumeric Alphanumericals are a combination of alphabetical and wiktionary:numerical, numerical Character (symbol), characters, and is u ...
encoding, character codes are written as hexadecimal pairs prefixed with =: Espa=F1a is "España" (F1 is the code for ñ in the ISO/IEC 8859-1 character set).) * In Intel-derived
assembly language In computer programming Computer programming is the process of designing and building an executable computer program to accomplish a specific computing result or to perform a particular task. Programming involves tasks such as analysis, gene ...
s and Modula-2, hexadecimal is denoted with a suffixed or : FFh or 05A3H. Some implementations require a leading zero when the first hexadecimal digit character is not a decimal digit, so one would write 0FFh instead of FFh. Some other implementations (such as NASM) allow C-style numbers (0x42). * Other assembly languages (
6502 The MOS Technology 6502 (typically pronounced "sixty-five-oh-two" or "six-five-oh-two") William Mensch and the moderator both pronounce the 6502 microprocessor as ''"sixty-five-oh-two"''. is an 8-bit In computer architecture In computer ...
,
Motorola Motorola, Inc. () was an American multinational Multinational may refer to: * Multinational corporation, a corporate organization operating in multiple countries * Multinational force, a military body from multiple countries * Multinational sta ...

Motorola
),
Pascal Pascal, Pascal's or PASCAL may refer to: People and fictional characters * Pascal (given name), including a list of people with the name * Pascal (surname), including a list of people and fictional characters with the name ** Blaise Pascal, French ...
,
Delphi Delphi (; ), in legend previously called Pytho (Πυθώ), in ancient times was a sacred precinct that served as the seat of , the major who was consulted about important decisions throughout the ancient classical world. The oracle was interna ...
, some versions of
BASIC BASIC (Beginners' All-purpose Symbolic Instruction Code) is a family of general-purpose, high-level programming language In computer science Computer science deals with the theoretical foundations of information, algorithms and the ar ...

BASIC
(
Commodore Commodore may refer to: Ranks * Commodore (rank) Commodore is a senior naval rank used in many navies which is equivalent to brigadier and air commodore that is superior to a navy captain, but below a rear admiral. It is either regarded as ...
), GameMaker Language, Godot and
Forth Forth or FORTH may refer to: Media * ''forth'' magazine, an English-language Irish Internet magazine * ''Forth'' (album), by the English alternative rock band The Verve * ''Forth'' (album), by the American progressive rock band Proto-Kaw * Rad ...
use $ as a prefix: $5A3. * Some assembly languages (Microchip) use the notation H'ABCD' (for ABCD16). Similarly,
Fortran 95 Fortran (; formerly FORTRAN) is a general-purpose, compiled In computing, a compiler is a computer program that Translator (computing), translates computer code written in one programming language (the ''source'' language) into another langu ...
uses Z'ABCD'. *
Ada Ada may refer to: Places Africa * Ada Foah Ada Foah is a town on the southeast coast of Ghana, where the Volta River meets the Atlantic Ocean. The town is located along the Volta River, off of the Accra-Aflao motorway. Known for Palm tree, pal ...
and
VHDL The VHSIC Hardware Description Language (VHDL) is a hardware description language In computer engineering, a hardware description language (HDL) is a specialized computer language used to describe the structure and behavior of electronic ci ...
enclose hexadecimal numerals in based "numeric quotes": 16#5A3#. For bit vector constants
VHDL The VHSIC Hardware Description Language (VHDL) is a hardware description language In computer engineering, a hardware description language (HDL) is a specialized computer language used to describe the structure and behavior of electronic ci ...
uses the notation x"5A3". *
Verilog Verilog, standardized as IEEE 1364, is a hardware description language In computer engineering, a hardware description language (HDL) is a specialized computer language used to describe the structure and behavior of electronic circuits, and m ...
represents hexadecimal constants in the form 8'hFF, where 8 is the number of bits in the value and FF is the hexadecimal constant. * The
Smalltalk Smalltalk is an object-oriented programming, object-oriented, dynamically typed reflection (computer science), reflective programming language. Smalltalk was created as the language underpinning the "new world" of computing exemplified by "human ...

Smalltalk
language uses the prefix 16r: 16r5A3 *
PostScript PostScript (PS) is a page description language In digital printing, a page description language (PDL) is a computer language that describes the appearance of a printed page in a higher level than an actual output bitmap (or generally raster gra ...

PostScript
and the
Bourne shell The Bourne shell (sh) is a shell Shell may refer to: Architecture and design * Shell (structure)A shell is a type of structural element which is characterized by its geometry, being a three-dimensional solid whose thickness is very small when c ...
and its derivatives denote hex with prefix 16#: 16#5A3. For PostScript, binary data (such as image
pixel In digital imaging Digital imaging or digital image acquisition is the creation of a representation of the visual characteristics of an object, such as a physical scene or the interior structure of an object. The term is often assumed to imp ...

pixel
s) can be expressed as unprefixed consecutive hexadecimal pairs: AA213FD51B3801043FBC... *
Common Lisp Common Lisp (CL) is a dialect of the Lisp programming language Lisp (historically LISP) is a family of programming language A programming language is a formal language In mathematics Mathematics (from Ancient Greek, Greek: ) incl ...
uses the prefixes #x and #16r. Setting the variables *read-base* and *print-base* to 16 can also be used to switch the reader and printer of a Common Lisp system to Hexadecimal number representation for reading and printing numbers. Thus Hexadecimal numbers can be represented without the #x or #16r prefix code, when the input or output base has been changed to 16. *
MSX BASIC MSX BASIC is a dialect of the BASIC programming language. It is an extended version of Microsoft's MBASIC Version 4.5, adding support for graphic, music, and various peripherals attached to MSX microcomputers. Generally, MSX-BASIC is designed to fol ...
,
QuickBASIC Microsoft QuickBASIC (also QB) is an Integrated Development Environment (or IDE) and compiler for the BASIC programming language that was developed by Microsoft. QuickBASIC runs mainly on DOS, though there was also a short-lived version for the c ...
,
FreeBASIC FreeBASIC is a multiplatform, free/ open source ( GPL) BASIC BASIC (Beginners' All-purpose Symbolic Instruction Code) is a family of General-purpose programming language, general-purpose, high-level programming languages whose design philosop ...
and
Visual Basic Visual Basic is a name for a family of programming languages from Microsoft. It may refer to: * Visual Basic (classic) The original Visual Basic (also referred to as Classic Visual Basic) is a third-generation programming language, third-gener ...
prefix hexadecimal numbers with &H: &H5A3 *
BBC BASIC BBC BASIC is a version of the BASIC programming language released in 1981 as the native programming language for the BBC Micro home/personal computer, providing a standardized language for a UK computer literacy project of the BBC. It was writt ...
and
Locomotive BASIC Locomotive Basic is a proprietary dialect of the BASIC programming language written by Locomotive Software on the Amstrad CPC (where it was built-in on Read-only memory, ROM) and the later Locomotive BASIC-2 as a GEM application on the Amstrad PC15 ...
use & for hex. *
TI-89 The TI-89 and the TI-89 Titanium are graphing calculator A graphing calculator (also graphics calculator or graphic display calculator) is a that is capable of plotting , solving , and performing other tasks with . Most popular grap ...

TI-89
and 92 series uses a 0h prefix: 0h5A3 * ALGOL 68 uses the prefix 16r to denote hexadecimal numbers: 16r5a3. Binary, quaternary (base-4) and octal numbers can be specified similarly. * The most common format for hexadecimal on IBM mainframes (
zSeries An IBM z14 mainframe. It is distinguished from the LinuxONE model by the blue accents on the doors. IBM Z is a family name used by IBM International Business Machines Corporation (IBM) is an American multinational technology company hea ...
) and midrange computers (
IBM i IBM i (the ''i'' standing for ''integrated'') is an operating system An operating system (OS) is system software System software is software designed to provide a platform for other software. Examples of system software include operating sys ...

IBM i
) running the traditional OS's ( zOS, zVSE, zVM,
TPF TPF may refer to: * Tibial plateau fracture * Theodore Payne Foundation for Wild Flowers and Native Plants * Transaction Processing Facility, an operating system by IBM * Terrestrial Planet Finder, a proposed system of telescopes to detect extrasola ...
,
IBM i IBM i (the ''i'' standing for ''integrated'') is an operating system An operating system (OS) is system software System software is software designed to provide a platform for other software. Examples of system software include operating sys ...

IBM i
) is X'5A3', and is used in Assembler,
PL/I PL/I (Programming Language One, pronounced and sometimes written PL/1) is a procedural, imperative Imperative may refer to: *Imperative mood, a grammatical mood (or mode) expressing commands, direct requests, and prohibitions *Imperative prog ...
,
COBOL COBOL (; an acronym An acronym is a word In linguistics, a word of a spoken language can be defined as the smallest sequence of phonemes that can be uttered in isolation with semantic, objective or pragmatics, practical meaning (lingui ...

COBOL
, JCL, scripts, commands and other places. This format was common on other (and now obsolete) IBM systems as well. Occasionally quotation marks were used instead of apostrophes. * Any
IPv6 address An Internet Protocol Version 6 address (IPv6 address) is a numeric label that is used to identify and locate a network interface of a computer or a network nodeIn telecommunications network A telecommunications network is a group of nodes int ...
can be written as eight groups of four hexadecimal digits (sometimes called
hextet In computing, a hextet, or a ''chomp'', is a sixteen-bit aggregation, or four nibbles. As a nibble typically is notated in hexadecimal format, a hextet consists of 4 hexadecimal digits. A hextet is the unofficial name for each of the 8 blocks in a ...
s), where each group is separated by a colon (:). This, for example, is a valid IPv6 address: or abbreviated by removing zeros as (
IPv4 address Internet Protocol version 4 (IPv4) is the fourth version of the Internet Protocol (IP). It is one of the core protocols of standards-based internetworking methods in the Internet The Internet (Capitalization of Internet, or internet ...
es are usually written in decimal). *
Globally unique identifier A universally unique identifier (UUID) is a 128-bit While there are currently no mainstream general-purpose processors built to operate on 128-bit ''integers'' or addresses, a number of processors do have specialized ways to operate on 128-bit ...
s are written as thirty-two hexadecimal digits, often in unequal hyphen-separated groupings, for example .


Other symbols for 10–15 and mostly different symbol sets

The use of the letters ''A'' through ''F'' to represent the digits above 9 was not universal in the early history of computers. * During the 1950s, some installations, such as Bendix-14 favored using the digits 0 through 5 with an
overline An overline, overscore, or overbar, is a typographical feature of a horizontal and vertical, horizontal line drawn immediately above the text. In old mathematical notation, an overline was called a ''vinculum (symbol), vinculum'', a notation f ...

overline
to denote the values 10–15 as , , , , and . * The SWAC (1950) and
Bendix G-15 The Bendix G-15 is a computer A computer is a machine that can be programmed to Execution (computing), carry out sequences of arithmetic or logical operations automatically. Modern computers can perform generic sets of operations known as Co ...
(1956) computers used the lowercase letters ''u'', ''v'', ''w'', ''x'', ''y'' and ''z'' for the values 10 to 15. * The
ORDVAC The ORDVAC (''Ordnance Discrete Variable Automatic Computer)'', is an early computer A computer is a machine that can be programmed to Execution (computing), carry out sequences of arithmetic or logical operations automatically. Modern comp ...

ORDVAC
and
ILLIAC I The ILLIAC I (Illinois Automatic Computer), a pioneering computer in the ILLIAC series of computers built in 1952 by the University of Illinois at Urbana–Champaign, University of Illinois, was the first computer built and owned entirely by a Un ...
(1952) computers (and some derived designs, e.g.
BRLESC 350px, The console of the BRLESC computer (US Army photo) The BRLESC I (Ballistic Research Laboratories Electronic Scientific Computer) was a first-generation electronic computer built by the United States Army's Ballistic Research Laboratory (BRL ...
) used the uppercase letters ''K'', ''S'', ''N'', ''J'', ''F'' and ''L'' for the values 10 to 15. * The Librascope
LGP-30 The LGP-30, standing for Librascope General Purpose and then Librascope General Precision, was an early off-the-shelf computer. It was manufactured by the Librascope Librascope was a Glendale, California Glendale is a city in the Verdugo Moun ...

LGP-30
(1956) used the letters ''F'', ''G'', ''J'', ''K'', ''Q'' and ''W'' for the values 10 to 15. * On the PERM (1956) computer, hexadecimal numbers were written as letters ''O'' for zero, ''A'' to ''N'' and ''P'' for 1 to 15. Many machine instructions had mnemonic hex-codes (''A''=add, ''M''=multiply, ''L''=load, ''F''=fixed-point etc.); programs were written without instruction names. * The
Honeywell Honeywell International Inc. is an American public company, publicly traded, multinational corporation, multinational conglomerate (company), conglomerate corporation headquartered in Charlotte, North Carolina. It primarily operates in four are ...

Honeywell
Datamatic D-1000 (1957) used the lowercase letters ''b'', ''c'', ''d'', ''e'', ''f'', and ''g'' whereas the
Elbit File:Hermes450 SIGINT Farnborough.jpg, 250px, Elbit Hermes 450 unmanned aerial vehicle Image:Elbit Hermes 900s.JPG, 250px, Elbit Hermes 900 unmanned aerial vehicle Elbit Systems Ltd. is an Israel-based international defense electronics company ...
 100 (1967) used the uppercase letters ''B'', ''C'', ''D'', ''E'', ''F'' and ''G'' for the values 10 to 15. * The Monrobot XI (1960) used the letters ''S'', ''T'', ''U'', ''V'', ''W'' and ''X'' for the values 10 to 15. * The
NEC is a Japanese multinational information technology and electronics Electronics comprises the physics, engineering, technology and applications that deal with the emission, flow and control of electrons in vacuum and matter. It uses active d ...
parametron computer NEAC 1103 (1960) used the letters ''D'', ''G'', ''H'', ''J'', ''K'' (and possibly ''V'') for values 10–15. * The Pacific Data Systems 1020 (1964) used the letters ''L'', ''C'', ''A'', ''S'', ''M'' and ''D'' for the values 10 to 15. * New numeric symbols and names were introduced in the
Bibi-binaryImage:Table de correspondance entre le Bibinaire et les autres notations.svg, 520px, Each Bibi digit is formed from a square arranging the 1-bits in its binary representation. If only a single bit is 1 a vertical line runs through the centre and end ...
notation by
Boby Lapointe Robert Jean-François Joseph Pascal Lapointe (; 16 April 1922 – 29 June 1972), better known by his stage name Boby Lapointe (), was a French actor and singer, noted for his humorous texts, alliteration In literature Literature broadly is an ...
in 1968. This notation did not become very popular. * Bruce Alan Martin of
Brookhaven National Laboratory Brookhaven National Laboratory (BNL) is a United States Department of Energy national laboratory located in Upton, New York Upton, New York is a hamlet ''The Tragedy of Hamlet, Prince of Denmark'', often shortened to ''Hamlet'' (), is a ...
considered the choice of A–F "ridiculous". In a 1968 letter to the editor of the CACM, he proposed an entirely new set of symbols based on the bit locations, which did not gain much acceptance. * Some
seven-segment display A seven-segment display is a form of electronic display device s, LED A light-emitting diode (LED) is a semiconductor A semiconductor material has an Electrical resistivity and conductivity, electrical conductivity value falling be ...
decoder chips (i.e., 74LS47) show unexpected output due to logic designed only to produce 0–9 correctly.


Verbal and digital representations

There are no traditional numerals to represent the quantities from ten to fifteen – letters are used as a substitute – and most European languages lack non-decimal names for the numerals above ten. Even though English has names for several non-decimal powers (''
pair Pair or PAIR or Pairing may refer to: Government and politics * Pair (parliamentary convention), matching of members unable to attend, so as not to change the voting margin * ''Pair'', a member of the Prussian House of Lords * ''Pair'', the Frenc ...

pair
'' for the first
binary Binary may refer to: Science and technology Mathematics * Binary number In mathematics and digital electronics Digital electronics is a field of electronics The field of electronics is a branch of physics and electrical engineeri ...
power, ''
score Score or scorer may refer to: *Test score, the result of an exam or test Business * Score Digital, now part of Bauer Radio#Score Digital, Bauer Radio * Score Entertainment, a former American trading card design and manufacturing company * Score ...
'' for the first
vigesimal A vigesimal () or base-20 (base-score) numeral system is based on 20 (number), twenty (in the same way in which the decimal, decimal numeral system is based on 10 (number), ten). ''wikt:vigesimal#English, Vigesimal'' is derived from the Latin adje ...
power, ''
dozen A dozen (commonly abbreviated doz or dz) is a grouping of 12 (number), twelve. The dozen may be one of the earliest primitive integer groupings, perhaps because there are approximately a dozen cycles of the Moon, or months, in a cycle of the Su ...
'', '' gross'' and ''
great gross 1728 is the natural number In mathematics, the natural numbers are those numbers used for counting (as in "there are ''six'' coins on the table") and total order, ordering (as in "this is the ''third'' largest city in the country"). In commo ...
'' for the first three
duodecimal The duodecimal system (also known as base 12, dozenal, or, rarely, uncial) is a positional notation Positional notation (or place-value notation, or positional numeral system) usually denotes the extension to any of the (or ). More generally ...
powers), no English name describes the hexadecimal powers (decimal 16, 256, 4096, 65536, ... ). Some people read hexadecimal numbers digit by digit, like a phone number, or using the
NATO phonetic alphabet The International Radiotelephony Spelling Alphabet, commonly known as the NATO phonetic alphabet, NATO spelling alphabet, ICAO phonetic alphabet or ICAO spelling alphabet, is the most widely used radiotelephone spelling alphabet Spelling is ...
, the
Joint Army/Navy Phonetic Alphabet The Allied military phonetic spelling alphabets prescribed the words that are used to represent each letter of the alphabet, when spelling other words out loud, letter-by-letter, and how the spelling words should be pronounced for use by the Allies ...
, or a similar ''ad-hoc'' system. In the wake of the adoption of hexadecimal among
IBM System/360 The IBM System/360 (S/360) is a family of mainframe computer A mainframe computer, informally called a mainframe or big iron, is a computer A computer is a machine that can be programmed to carry out sequences of arithmetic or ...
programmers, Magnuson (1968) suggested a pronunciation guide that gave short names to the letters of hexadecimal – for instance, "A" was pronounced "ann", B "bet", C "chris", etc. Another naming system was elaborated by Babb (2015), off a TV series as a joke. Yet another naming-system was published online by Rogers (2007) that tries to make the verbal representation distinguishable in any case, even when the actual number does not contain numbers A–F. Examples are listed in the tables below. Systems of counting on digits have been devised for both binary and hexadecimal.
Arthur C. Clarke Sir Arthur Charles Clarke (16 December 191719 March 2008) was an English science-fiction writer, science writer, futurist Futurists (also known as futurologists, prospectivists, Foresight (futures studies), foresight practitioners and hori ...
suggested using each finger as an on/off bit, allowing finger counting from zero to 102310 on ten fingers. Another system for counting up to FF16 (25510) is illustrated on the right.


Signs

The hexadecimal system can express negative numbers the same way as in decimal: −2A to represent −4210 and so on. Hexadecimal can also be used to express the exact bit patterns used in the , so a sequence of hexadecimal digits may represent a
signed Signing may refer to: * Using sign language * Signature, placing one's name on a document * Signature (disambiguation) * Manual communication, signing as a form of communication using the hands in place of the voice * Digital signature, signing as ...
or even a
floating-point In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithm of an algorithm (Euclid's algorithm) for calculating the greatest com ...
value. This way, the negative number −4210 can be written as FFFF FFD6 in a 32-bit
CPU register A processor register is a quickly accessible location available to a computer's processor. Registers usually consist of a small amount of fast storage, although some registers have specific hardware functions, and may be read-only or write-only. ...
(in
two's-complementTwo's complement is a mathematical operation on binary numbers, and is an example of a radix complement. It is used in computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the ...
), as C228 0000 in a 32-bit FPU register or C045 0000 0000 0000 in a 64-bit FPU register (in the
IEEE floating-point standard The IEEE Standard for Floating-Point Arithmetic (IEEE 754) is a technical standard A technical standard is an established norm or requirement for a repeatable technical task. It is usually a formal document that establishes uniform engineering ...
).


Hexadecimal exponential notation

Just as decimal numbers can be represented in
exponential notation Scientific notation is a way of expressing real numbers, numbers that are too large or too small (usually would result in a long string of digits) to be conveniently written in decimal form. It may be referred to as scientific form or standard in ...
, so too can hexadecimal numbers. By convention, the letter ''P'' (or ''p'', for "power") represents ''times two raised to the power of'', whereas ''E'' (or ''e'') serves a similar purpose in decimal as part of the
E notation Scientific notation is a way of expressing real numbers, numbers that are too large or too small (usually would result in a long string of digits) to be conveniently written in decimal form. It may be referred to as scientific form or standard in ...
. The number after the ''P'' is ''decimal'' and represents the ''binary'' exponent. Increasing the exponent by 1 multiplies by 2, not 16. 10.0p1 = 8.0p2 = 4.0p3 = 2.0p4 = 1.0p5. Usually, the number is normalized so that the leading hexadecimal digit is 1 (unless the value is exactly 0). Example: 1.3DEp42 represents . Hexadecimal exponential notation is required by the
IEEE 754-2008 The Institute of Electrical and Electronics Engineers (IEEE) is a professional association A professional association (also called a professional body, professional organization, or professional society) usually seeks to further Further or ...
binary floating-point standard. This notation can be used for floating-point literals in the
C99 C99 (previously known as C9X) is an informal name for ISO/IEC 9899:1999, a past version of the C programming language C (, as in the letter ''c'') is a general-purpose, procedural computer programming language A programming language ...

C99
edition of the
C programming language C (, as in the letter ''c'') is a general-purpose, procedural computer programming language A programming language is a formal language comprising a Instruction set architecture, set of instructions that produce various kinds of Input/outp ...
. Using the ''%a'' or ''%A'' conversion specifiers, this notation can be produced by implementations of the ''
printf printf format string refers to a control parameter used by a class of functions Function or functionality may refer to: Computing * Function key A function key is a key on a computer A computer is a machine that can be programmed t ...

printf
'' family of functions following the C99 specification and
Single Unix Specification The Single UNIX Specification (SUS) is the collective name of a family of standards for computer A computer is a machine that can be programmed to Execution (computing), carry out sequences of arithmetic or logical operations automatically. ...
(IEEE Std 1003.1)
POSIX The Portable Operating System Interface (POSIX) is a family of standard Standard may refer to: Flags * Colours, standards and guidons * Standard (flag), a type of flag used for personal identification Norm, convention or requirement * St ...
standard.


Conversion


Binary conversion

Most computers manipulate binary data, but it is difficult for humans to work with a large number of digits for even a relatively small binary number. Although most humans are familiar with the base 10 system, it is much easier to map binary to hexadecimal than to decimal because each hexadecimal digit maps to a whole number of bits (410). This example converts 11112 to base ten. Since each position in a binary numeral can contain either a 1 or a 0, its value may be easily determined by its position from the right: * 00012 = 110 * 00102 = 210 * 01002 = 410 * 10002 = 810 Therefore: With little practice, mapping 11112 to F16 in one step becomes easy: see table in written representation. The advantage of using hexadecimal rather than decimal increases rapidly with the size of the number. When the number becomes large, conversion to decimal is very tedious. However, when mapping to hexadecimal, it is trivial to regard the binary string as 4-digit groups and map each to a single hexadecimal digit. This example shows the conversion of a binary number to decimal, mapping each digit to the decimal value, and adding the results. Compare this to the conversion to hexadecimal, where each group of four digits can be considered independently, and converted directly: The conversion from hexadecimal to binary is equally direct.


Other simple conversions

Although
quaternary The Quaternary ( ) is the current and most recent of the three periods of the Cenozoic The Cenozoic ( ; ) is Earth's current geological era An era is a span of time defined for the purposes of chronology or historiography, as in the regnal ...

quaternary
(base 4) is little used, it can easily be converted to and from hexadecimal or binary. Each hexadecimal digit corresponds to a pair of quaternary digits and each quaternary digit corresponds to a pair of binary digits. In the above example 5 E B 5 216 = 11 32 23 11 024. The
octal The octal numeral system, or oct for short, is the radix, base-8 number system, and uses the Numerical digit, digits 0 to 7, that is to say 10 represents 8 in decimal and 100 represents 64 in decimal. However, English uses a Base 10, base-10 num ...

octal
(base 8) system can also be converted with relative ease, although not quite as trivially as with bases 2 and 4. Each octal digit corresponds to three binary digits, rather than four. Therefore, we can convert between octal and hexadecimal via an intermediate conversion to binary followed by regrouping the binary digits in groups of either three or four.


Division-remainder in source base

As with all bases there is a simple
algorithm In and , an algorithm () is a finite sequence of , computer-implementable instructions, typically to solve a class of problems or to perform a computation. Algorithms are always and are used as specifications for performing s, , , and other ...

algorithm
for converting a representation of a number to hexadecimal by doing integer division and remainder operations in the source base. In theory, this is possible from any base, but for most humans only decimal and for most computers only binary (which can be converted by far more efficient methods) can be easily handled with this method. Let d be the number to represent in hexadecimal, and the series hihi−1...h2h1 be the hexadecimal digits representing the number. # i ← 1 # hi ← d mod 16 # d ← (d − hi) / 16 # If d = 0 (return series hi) else increment i and go to step 2 "16" may be replaced with any other base that may be desired. The following is a
JavaScript JavaScript (), often abbreviated JS, is a programming language A programming language is a formal language In mathematics Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), ma ...

JavaScript
implementation of the above algorithm for converting any number to a hexadecimal in String representation. Its purpose is to illustrate the above algorithm. To work with data seriously, however, it is much more advisable to work with
bitwise operators In computer programming Computer programming is the process of designing and building an executable computer program to accomplish a specific computing result or to perform a specific task. Programming involves tasks such as: analysis, gener ...
. function toHex(d) function toChar(n)


Conversion through addition and multiplication

It is also possible to make the conversion by assigning each place in the source base the hexadecimal representation of its place value — before carrying out multiplication and addition to get the final representation. For example, to convert the number B3AD to decimal, one can split the hexadecimal number into its digits: B (1110), 3 (310), A (1010) and D (1310), and then get the final result by multiplying each decimal representation by 16''p'' (''p'' being the corresponding hex digit position, counting from right to left, beginning with 0). In this case, we have that: which is 45997 in base 10.


Tools for conversion

Many computer systems provide a calculator utility capable of performing conversions between the various radices frequently including hexadecimal. In
Microsoft Windows Microsoft Windows, commonly referred to as Windows, is a group of several proprietary {{Short pages monitor Binary arithmetic Hexadecimal numeral system Power-of-two numeral systems Positional numeral systems