EasyUnitConverter.com

ASCII, Hex, Binary, Decimal & Base64 Converter

Convert text between ASCII, hexadecimal, binary, decimal, and Base64 formats instantly. Edit any field and all other formats update live. Essential for programmers, network engineers, and computer science students. See also our Binary to ASCII and Hex to ASCII converters.

Enter or edit any field below — all other formats will update automatically.

How to Convert ASCII, Hex, Binary & Decimal

  1. Select the input type from the dropdown (Text, Hex, Binary, Decimal, or Base64).
  2. Enter your value in the text area.
  3. Click Convert to see all representations simultaneously.
  4. Copy any result using the Copy button next to each format.
  5. Switch input types to convert from any format to all others.

ASCII:

ASCII stands for "American Standard Code for Information Interchange". The computer understands only numbers (0,1) to understand alphabets ASCII codes used. The list of 128 ASCII encodes characters which include 95 printable characters arranged into 7-bit integers. The printable characters include digits 0 - 9, lower letters a to z, upper letters A to Z and symbols.

Example:

In ASCII encodes lower letter "m" represent in the binary format as "01001101", Hexadecimal as "4D" and decimal as "109".

Hexadecimal:

A hexadecimal number is also called base-16 number system cause it has 16 digits in it from 0 to 9 & A to F. In computer languages coding it makes easy to write large numbers. Example for hexadecimal is 4B6. Each hex digit represents exactly 4 binary bits, making it the preferred format for representing memory addresses, color codes (#FF5733), and byte-level data.

Binary:

A binary number system having two numbers "0", "1" and it is known as Base-2 number system. The base-2 number system used in digital electronics to write instruction for electronic equipment and invented by Gottfried Leibniz. In this zero represents OFF, 1 represents ON cause electronic equipment used gates. Example of a binary number is 10110.

Decimal:

A decimal number system is also called a Base-10 (Hindu Arabic) number system. In this system 10 digits used they are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. In this system, we can write fractional numbers. Example of a decimal number is 129.56. Each ASCII character has a unique decimal value from 0 to 127 (standard) or 0 to 255 (extended).

Base64:

It is a binary to ASCII converter with a base64 format that introduces from MIME encoding scheme. Base64 used to keep data unchanged while transfers over media (ex: mail). For base64 different type of implementation follows but for MIME use for first 62 values lower case a-z, uppercase A-Z, and numbers 0-9. In other base64 implementation use different symbols for last two digits.

Conversion Formulas

ASCII to Binary: For each character: binary = charCode.toString(2).padStart(8, '0') Example: 'A' → 65 → 01000001 ASCII to Hexadecimal: For each character: hex = charCode.toString(16).padStart(2, '0') Example: 'A' → 65 → 41 ASCII to Decimal: For each character: decimal = charCode Example: 'A' → 65 ASCII to Base64: Encode using btoa() or manual 6-bit grouping Example: 'Hello' → 'SGVsbG8=' Binary to ASCII: For each 8-bit group: char = String.fromCharCode(parseInt(binary, 2)) Example: 01000001 → 65 → 'A' Hex to ASCII: For each 2-digit pair: char = String.fromCharCode(parseInt(hex, 16)) Example: 41 → 65 → 'A'

ASCII Reference Table

CharacterDecimalHexBinary
A654101000001
B664201000010
Z905A01011010
a976101100001
z1227A01111010
0483000110000
9573900111001
Space322000100000

Frequently Asked Questions

What is ASCII encoding?

ASCII (American Standard Code for Information Interchange) is a character encoding standard that assigns numeric values to 128 characters including letters, digits, punctuation, and control characters. It uses 7 bits per character (values 0-127).

How do I convert text to binary?

Each character is first converted to its ASCII decimal value, then that decimal number is converted to an 8-bit binary representation. For example, 'H' = 72 in decimal = 01001000 in binary.

What is Base64 encoding used for?

Base64 encodes binary data into ASCII text using 64 characters (A-Z, a-z, 0-9, +, /). It is used for email attachments (MIME), embedding images in HTML/CSS (data URIs), and transmitting binary data over text-only protocols.

Why is hexadecimal used in computing?

Hexadecimal is compact (each digit = 4 bits) and human-readable compared to binary. One byte (8 bits) is always exactly 2 hex digits (00-FF). It is used for memory addresses, color codes, MAC addresses, and debugging.

What is the difference between ASCII and Unicode?

ASCII defines 128 characters using 7 bits. Unicode extends this to over 143,000 characters covering all world scripts. UTF-8 is the most common Unicode encoding, where ASCII characters (0-127) use 1 byte and other characters use 2-4 bytes.

Objective of Measurement:

Measurement is the most important aspect of our life. We use measurement in science, engineering, business trading, personal life, education, and more other fields. As technology is growing day by day so we need a highly accurate and easy convenient global measuring system in each and every field. It is essential to use standard measurement in every field that everyone to be sure that they not get cheated.

History of Measurement:

In history for measurement people used the human body as a tool. For measuring length used forearm, hand, foot & finger as a unit. The foot, finger is a subdivided shorter unit of a length. This type of measurement is not accurate cause different in size of the arm & finger for different people & some of the countries still using it. In history, there were lots of measuring systems developed but mostly used imperial, the metric system of measurement. We use these systems for measure distances, volume, weight, speed, area etc. Due to this a major problem everyone is facing while doing trading between the countries. A huge improvement in civilization, It necessary to improve measuring standards. Nowadays International Standard (SI) units are used as a global measurement system.

Solved Examples

Example 1: Convert the word "Code" to hexadecimal

Step 1: Find ASCII code for each character — C=67, o=111, d=100, e=101.

Step 2: Convert each to hex — 67=43, 111=6F, 100=64, 101=65.

Answer: "Code" = 43 6F 64 65 in hexadecimal

Example 2: Decode the binary message 01001000 01101001

Step 1: Convert first byte — 01001000 = 72 decimal = 'H'.

Step 2: Convert second byte — 01101001 = 105 decimal = 'i'.

Answer: The binary message reads "Hi"

Example 3: A web developer sees color code #4A7F2B. What are the RGB decimal values?

Step 1: Split into pairs — 4A, 7F, 2B.

Step 2: Convert each hex pair — 4A = 4×16+10 = 74 (Red), 7F = 7×16+15 = 127 (Green), 2B = 2×16+11 = 43 (Blue).

Answer: RGB(74, 127, 43) — a forest green color

Example 4: Encode "OK" in Base64

Step 1: ASCII codes — O=79 (01001111), K=75 (01001011).

Step 2: Combine bits: 010011110100101. Pad to multiple of 6: 010011 110100 101100.

Step 3: Convert 6-bit groups to Base64 chars: 19=T, 52=0, 44=s. Add padding '='.

Answer: "OK" = "T0s=" in Base64

Practice Questions

  1. What is the ASCII decimal code for the letter 'Z'? (Answer: 90)
  2. Convert hexadecimal 48 65 6C 6C 6F to ASCII text. (Answer: Hello)
  3. What does the binary 01000001 represent in ASCII? (Answer: A)
  4. Convert the character '7' to its binary representation. (Answer: 00110111)
  5. What is the hexadecimal representation of the space character? (Answer: 20)
  6. Decode Base64 string "QUJD" to ASCII text. (Answer: ABC)

Common Mistakes to Avoid

The most frequent error is confusing the ASCII code for a digit character with the digit itself. The character '0' has ASCII code 48 (hex 30), not 0. Similarly, '9' is ASCII 57, not 9. There is a consistent offset of 48 for digit characters. Another common mistake is mixing up uppercase and lowercase letters — 'A' is 65 (hex 41) while 'a' is 97 (hex 61), a difference of 32. When working with binary, forgetting to pad to 8 bits per character leads to ambiguous results — always use full bytes (01000001, not 1000001). In hexadecimal, remember each byte is exactly 2 hex digits — a single hex digit only represents 4 bits (a nibble). For Base64, the padding character '=' is not part of the encoded data but ensures the output length is a multiple of 4 — forgetting padding will cause decoding errors. Finally, ASCII only covers characters 0–127; extended characters (128–255) depend on the encoding scheme (Latin-1, Windows-1252, etc.) and are not part of standard ASCII.

Key Takeaways

  • ASCII assigns a unique number (0–127) to each character. Letters start at 65 (A) and 97 (a); digits start at 48 (0).
  • Hexadecimal is the preferred format for representing bytes — each byte is exactly 2 hex digits (00–FF).
  • Binary representation uses 8 bits (1 byte) per ASCII character, with values from 00000000 to 01111111.
  • Base64 encodes binary data into printable ASCII using 64 characters, expanding data by ~33% in size.
  • This tool is essential for debugging network protocols, analyzing file formats, and understanding character encoding.
  • Modern text uses Unicode/UTF-8, which is backward-compatible with ASCII for the first 128 characters.

Related Converters: