Convert ASCII to Hex, Binary, Decimal and More

Converting ASCII to hex means taking each character of text and writing its number code in hexadecimal. The letter A has the ASCII code 65, which is 41 in hex, so the text A becomes 41. The same idea lets you convert ASCII to binary, decimal, octal, Unicode, and more, because every character is really just a number underneath. This guide covers the full set of ASCII converters and shows what each one is for.

ASCII: every character is a number

ASCII is the standard that gives every basic character a number. The capital letter A is 65, lowercase a is 97, the digit 0 is 48, and a space is 32. Once a character is a number, it can be written in any base or encoding, which is exactly what these converters do.

So an ASCII converter is really a two-step tool: it looks up each character’s number, then writes that number in the format you asked for. The numbers come from the same table behind our guide to online converters, and they are what makes every conversion below possible.

Convert ASCII to hex, binary, decimal and octal

The most common ASCII conversions write each character’s code in a different number base. The ASCII to hex converter is the one people reach for most, since hex is the compact form used in programming and data inspection. The ASCII to binary converter shows the raw bits, and the ASCII to decimal converter gives the plain code numbers.

For the base-8 form, the ASCII to octal converter does the same job in octal. All four take the same text and differ only in how they write each character’s code.

Convert ASCII to Unicode and UTF-8

ASCII only covers basic English characters. Unicode extends that to every writing system and symbol, and UTF-8 is the encoding that stores Unicode efficiently. The ASCII to Unicode converter maps text to its Unicode code points, and the ASCII to UTF-8 converter shows how those characters are stored as bytes. These matter the moment your text includes anything beyond plain English letters.

Convert ASCII to HTML entities and Base64

Two conversions prepare text for specific destinations. The ASCII to HTML entities converter rewrites characters that have special meaning in web pages, such as the angle brackets in tags, so they display as text instead of being read as code.

The ASCII to Base64 converter packages text into the Base64 form used to carry data safely through email, URLs, and JSON. Both take ordinary text and make it safe for a place that would otherwise mangle it.

One letter, every format

The capital letter A has the ASCII code 65. In hex that is 41, in binary it is 01000001, in decimal it is 65, and in octal it is 101. Every converter above starts from that same code number and simply writes it in its own format. Nothing about the character changes, only the notation, which is why these conversions are exact and reversible.

Frequently asked questions

How do I convert ASCII to hex?

Look up each character’s ASCII code, then write that code in hexadecimal. The ASCII to hex converter does both steps for the whole text at once.

What is the ASCII code for A in hex?

The capital letter A has the ASCII code 65, which is 41 in hexadecimal.

What is the difference between ASCII and Unicode?

ASCII covers basic English characters in a single byte each. Unicode covers every writing system and symbol, and UTF-8 stores it efficiently. Use a Unicode converter when text goes beyond plain English.

Why convert text to HTML entities?

Characters like angle brackets have special meaning in web pages. Converting them to HTML entities makes them display as text rather than being read as code.

Are ASCII conversions reversible?

Yes. They only change how each character’s code is written, so the text can be converted back without any loss.

Convert Binary to Decimal, Hex and Octal

To convert binary to decimal, you add up the place values wherever the binary number has a 1. Binary 1101 has a 1 in the eight, four, and one positions, so it is 8 plus 4 plus 1, which is 13. The same binary string can also be written as hexadecimal or octal, and each is just a different, shorter way of showing the same value. This guide shows how to convert binary to decimal, hex, and octal, with the rule behind each and a free tool for the job.

The place-value rule

Binary has two digits, 0 and 1, and each position is worth twice the one to its right: 1, 2, 4, 8, 16, and so on. Reading a binary number means adding the position values wherever a 1 sits. That single rule is the basis of every conversion here, and it is covered in more depth in our guide to number systems.

Decimal, hexadecimal, and octal are simply three different groupings of those same bits. Decimal is the everyday base-10 form, hex groups the bits in fours, and octal groups them in threes. Nothing about the underlying value changes between them.

Convert binary to decimal

Decimal is the base-10 system people count in, so converting binary to decimal turns a machine value into a number you can read at a glance. You add the place values for every 1 in the string, exactly as in the rule above.

For a short number this is quick, but for a long byte or a 16-bit value it is slow and easy to miscount, so the binary to decimal converter does it instantly. Paste the binary and it returns the decimal number.

Convert binary to hexadecimal

Hexadecimal uses sixteen digits, 0 to 9 then A to F, and its key feature is that one hex digit is exactly four bits. That makes hex the compact, readable form of binary used for colour codes, memory addresses, and raw byte data.

To convert by hand you split the binary into groups of four bits from the right and write each group as its hex digit. The binary to hex converter handles the grouping and lookup for you, which removes the most common mistake, splitting the bits in the wrong place.

Convert binary to octal

Octal uses eight digits, 0 to 7, and one octal digit is exactly three bits. It is the older shorthand still seen in Unix and Linux file permissions, where a value like 755 is octal. The binary to octal converter groups the bits in threes and returns the octal value.

One number, three formats

Take the byte 11010110. As decimal it is 214. Grouped into fours, 1101 and 0110, it is D6 in hex. Grouped into threes from the right, 11 010 110, it is 326 in octal. Three different notations, one identical value. Run any of them through the matching converter and you get the same result, because the conversion only changes how the value is written, never the value itself.

Free converters used in this guide

Why these conversions matter

Programmers meet all of these systems daily. A memory address is read in hex, a file permission is set in octal, and a calculated result is checked in decimal. Being able to move a value between them, or letting a converter do it, is part of routine debugging and low-level work. It is also the first thing most computer science courses teach, because it explains how a machine that only knows 0 and 1 can store any number at all.

Frequently asked questions

How do I convert binary to decimal?

Add the place values for every 1 in the binary string, where the positions from the right are worth 1, 2, 4, 8, and so on. A binary to decimal converter adds them up for you.

What is binary 1101 in decimal?

Binary 1101 is 8 plus 4 plus 1, which is 13 in decimal.

Why is hexadecimal grouped in fours?

Because one hexadecimal digit represents exactly four bits, so any group of four binary digits maps cleanly to a single hex digit.

Is converting binary to decimal reversible?

Yes. The value is identical in every base, so the conversion is lossless and the same number can be written back in binary without any change.

What is octal still used for?

Most commonly Unix and Linux file permissions, where a setting such as 755 is an octal number. One octal digit equals three bits.

Number Systems Explained: Binary, Hexadecimal, Octal and Decimal

Number systems are the different ways of writing the same value. The quantity that decimal writes as 255, binary writes as 11111111, and hexadecimal writes as FF. These are not different numbers. They are the same amount in different notation. Computers rely on several of these notations at once, and knowing how they relate explains a great deal of what you see in code, in colour values, and in raw file data. This guide explains the four number systems you will actually meet, decimal, binary, hexadecimal, and octal, and how to convert between them.

Why computers use more than one number system

A computer is built from switches, and each switch is either off or on. Those two states are the two digits of binary, 0 and 1, and binary is the only system the hardware truly uses. Everything else exists for the people reading it.

Binary is correct but hard to read. A single byte is eight digits long, and a memory address can run past thirty. Hexadecimal packs that same information into a quarter of the digits, so programmers use hex to read and write what the machine stores as binary. Decimal is the system people count in day to day. Octal is an older shorthand that still appears in a few specific places. Each system carries the same information, written for whoever needs to read it.

Decimal: base 10, the system you already use

Decimal is the system you grew up with. It has ten digits, 0 through 9. Its proper name, base 10, describes the rule behind it: each place is worth ten times the place to its right. In the number 4253, the 3 is worth 3, the 5 is worth 50, the 2 is worth 200, and the 4 is worth 4000.

Nothing about base 10 is special to mathematics. We use it because people have ten fingers. A computer has no fingers, so it has no reason to count in tens, and internally it does not.

Binary: base 2, how computers count

Binary has two digits, 0 and 1, and each digit is called a bit. Each place is worth twice the place to its right: 1, 2, 4, 8, 16, and so on. To read a binary number, add the place values wherever a 1 sits.

The binary number 1101 has a 1 in the 8 place, the 4 place, and the 1 place, so it equals 8 plus 4 plus 1, which is 13 in decimal. Eight bits together make a byte, and one byte can hold any value from 0 to 255. Binary is exact and it matches the hardware directly, but it is long and easy to misread, which is the reason the other systems exist. To turn a binary value into everyday decimal, the binary to decimal converter does it instantly.

Hexadecimal: base 16, binary made readable

Hexadecimal, usually shortened to hex, has sixteen digits. The first ten are 0 through 9, and the next six are the letters A through F, where A stands for 10 and F stands for 15.

Hex matters because of how cleanly it fits binary: one hex digit is exactly four bits. That means a byte, which is eight bits, is always exactly two hex digits. The byte 11111111 is FF, and 00000000 is 00. This is why hex appears everywhere a person needs to read binary data. A colour written as #1D9E75 is three bytes shown as six hex digits, one pair each for red, green, and blue. The binary to hex converter turns a binary value into hex.

Octal: base 8, the older shorthand

Octal has eight digits, 0 through 7. One octal digit is exactly three bits, the same idea as hex but in smaller groups.

Octal was common on older computer systems and is now mostly a niche. It still appears in a few places, the best known being file permissions on Unix and Linux systems, where a permission written as 755 is an octal number. The binary to octal converter handles that conversion. For most modern work, hex has replaced octal.

How to convert between number systems

Converting by hand is straightforward arithmetic, but it is slow and easy to slip on, especially with long values. The practical approach is a converter.

The binary to decimal, binary to hex, and binary to octal converters each take a binary value and return it in the system you need. The full set lives in the binary tools category and the number tools category. Each one runs in your browser with no signup, and the value never leaves your device.

From text to numbers: ASCII and character codes

Number systems explain how a computer stores numbers. Text is stored the same way, also as numbers. Every letter, digit, and symbol is assigned a code by a standard called ASCII. The capital letter A is 65, lowercase a is 97, and the digit 0 is 48. Those codes are then held in binary, so the letter A becomes 01000001.

This is the bridge between the text you type and the bits on disk. The ASCII to binary converter shows a piece of text as its binary codes, the binary to text converter reverses it, and the ASCII to hex converter shows the same text as hex codes.

Bitwise operations: working with bits directly

Sometimes you need to work on the bits themselves rather than the value they represent. Bitwise operations compare two binary numbers one bit at a time. AND returns a 1 only where both inputs have a 1. OR returns a 1 where either input does. XOR returns a 1 where exactly one input does.

These three operations are the building blocks of low-level programming, permission flags, and simple encryption. The binary AND tool performs a bitwise AND on two values, the binary addition tool adds two binary numbers, and the bitwise hex calculator works directly on hexadecimal values.

Special encodings: BCD and Gray code

Two specialised encodings round out the picture. BCD, short for binary coded decimal, stores each decimal digit as its own four-bit group instead of converting the whole number at once. It is used where a value must map cleanly back to separate decimal digits, such as some clocks and numeric displays. The BCD to decimal converter handles it.

Gray code is a binary sequence arranged so that any two consecutive values differ by only one bit. That property prevents read errors in hardware like rotary encoders, where several bits changing at once could be misread. The binary to Gray code converter produces it.

Quick reference

SystemBaseDigitsOne digit equalsCommon use
Decimal100 to 9n/aEveryday counting
Binary20 and 11 bitHow hardware stores everything
Octal80 to 73 bitsUnix file permissions
Hexadecimal160 to 9, A to F4 bitsColours, memory, byte data

Frequently asked questions

Why do computers use binary?

Computer hardware is built from switches that are either off or on. Those two states map directly onto the two binary digits, 0 and 1, so binary is the natural system for the machine.

What is hexadecimal used for?

Hex is a short, readable way to write binary. One hex digit equals exactly four bits, which makes it ideal for colour codes, memory addresses, and raw byte data.

Is binary 1101 the same as decimal 1101?

No. Binary 1101 equals decimal 13. The same digits represent different values depending on the base they are written in.

What is a byte?

A byte is a group of eight bits. It can hold any value from 0 to 255, which is exactly two hexadecimal digits.

Where is octal still used?

The most common place is Unix and Linux file permissions, where a setting such as 755 is an octal number.