Hex to Decimal

Hex to ASCII Converter

Type hex bytes to decode them into text, or type text to see its hex bytes. Each byte shows its hex value, decimal value and character. The sections below cover the method, ASCII and UTF-8, the full ASCII table, worked examples, code in seven languages and common questions.

Byte by byte

What is hex to text conversion?

Hex to text conversion decodes hexadecimal (hex) byte values into readable characters. Each pair of hex digits is one byte, and each byte maps to a character through an encoding table such as ASCII or UTF-8. The hex string 48 65 6C 6C 6F becomes “Hello” because 48 = H, 65 = e, 6C = l, 6C = l and 6F = o.

Hex to text, hex to ASCII, hex to string and hex decoder all name the same operation: turning hex-encoded bytes into the characters they stand for. Only the character encoding differs. ASCII covers 128 characters (codes 0–127). UTF-8 covers every Unicode character with one to four bytes each, and it keeps the ASCII codes unchanged.

Programmers, network analysts and security researchers read hex daily in packet captures, log files, memory dumps and encoded payloads. A hex to text converter turns those raw bytes into readable output without manual calculation. Edit the bytes in the visual, or pick an example.

How hex to text conversion works

To convert hex bytes to text, follow three steps:

  1. Split the hex string into pairs of two digits. Each pair is one byte. Remove spaces, commas and the 0x prefix first.
  2. Convert each hex pair to its decimal value. Multiply the first digit by 16 and add the second. For hex 48: 4 × 16 + 8 = 72.
  3. Look up the decimal value in the character table. Decimal 72 is the letter H in ASCII and UTF-8.

Repeat for every pair. The decoded characters, read from left to right, form the text.

Worked example: decode 48 65 6C 6C 6F 2C 20 77 6F 72 6C 64 21

HexDecimalChar
4872H
65101e
6C108l
6C108l
6F111o
HexDecimalChar
2C44,
2032(space)
77119w
6F111o
HexDecimalChar
72114r
6C108l
64100d
2133!

Result: Hello, world!

Text to hex (reverse conversion)

To convert text to hex, reverse the process: look up each character’s decimal code, then write it as a two-digit hex value. The letter A has decimal code 65, and 65 in hex is 41. A space is decimal 32, hex 20. Type any text below to see its bytes.

Character encoding: ASCII, UTF-8 and Unicode

Three standards decide how hex bytes map to characters. The encoding you choose affects which characters decode correctly.

ASCII (American Standard Code for Information Interchange)

ASCII is a 7-bit encoding that defines 128 characters: 33 control codes (hex 00–1F and 7F), a space (hex 20), the digits 0–9 (hex 30–39), uppercase A–Z (hex 41–5A), lowercase a–z (hex 61–7A) and 32 punctuation marks. It uses one byte per character and covers English text, digits and common symbols.

An uppercase letter and its lowercase twin differ by hex 20 (decimal 32): A is 41 and a is 61. That holds for all 26 letters, because only one bit changes.

UTF-8

UTF-8 is a variable-length encoding that covers every Unicode character. It uses one to four bytes per character:

First byte (hex)Total bytesCharacter rangeExample
00–7F1ASCII (U+0000–U+007F)41 = A
C2–DF2Latin, Greek, Cyrillic, Arabic (U+0080–U+07FF)C3 A9 = é
E0–EF3CJK, symbols, currency (U+0800–U+FFFF)E2 82 AC = €
F0–F44Emoji, rare scripts (U+10000–U+10FFFF)F0 9F 98 80 = 😀

UTF-8 keeps every ASCII code identical, so valid ASCII text is also valid UTF-8. The first byte of a multi-byte sequence tells the decoder how many bytes follow. Most files and web pages use UTF-8. Type a character to see how its code point fills the byte template.

Unicode

Unicode gives every character a unique number called a code point, written U+ followed by hex digits. UTF-8 is the most common way to store code points as bytes. Other formats are UTF-16 (2 or 4 bytes per character) and UTF-32 (4 bytes per character).

CharacterCode pointUTF-8 bytesDecimal
AU+00414165
éU+00E9C3 A9233
€U+20ACE2 82 AC8,364
😀U+1F600F0 9F 98 80128,512

Unicode supports over 149,000 characters from more than 160 writing systems, including Latin, Arabic, Chinese, Japanese, Korean, Devanagari and emoji. Compare the storage cost of one character below.

Useful ASCII ranges in hex

Tap a block on the number line to see what lives there.

Hex rangeDecimalCharacters
00–1F0–3132 control codes: 0A is line feed (LF), 0D is carriage return (CR), 09 is tab
2032Space
21–2F33–47Punctuation: ! " # $ % & ' ( ) * + , - . /
30–3948–57Digits 0–9
41–5A65–90Uppercase letters A–Z
61–7A97–122Lowercase letters a–z
7F127DEL (delete), the last ASCII code

Hex to ASCII table

All 128 ASCII codes with their hex value, decimal value and character. Codes 00–1F and 7F are control codes, shown by their standard abbreviations. Hover or tap a cell in the map to read its code.

DecHexChar
000NUL
101SOH
202STX
303ETX
404EOT
505ENQ
606ACK
707BEL
808BS
909TAB
100ALF
110BVT
120CFF
130DCR
140ESO
150FSI
1610DLE
1711DC1
1812DC2
1913DC3
2014DC4
2115NAK
2216SYN
2317ETB
2418CAN
2519EM
261ASUB
271BESC
281CFS
291DGS
301ERS
311FUS
DecHexChar
3220space
3321!
3422"
3523#
3624$
3725%
3826&
3927'
4028(
4129)
422A*
432B+
442C,
452D-
462E.
472F/
48300
49311
50322
51333
52344
53355
54366
55377
56388
57399
583A:
593B;
603C<
613D=
623E>
633F?
DecHexChar
6440@
6541A
6642B
6743C
6844D
6945E
7046F
7147G
7248H
7349I
744AJ
754BK
764CL
774DM
784EN
794FO
8050P
8151Q
8252R
8353S
8454T
8555U
8656V
8757W
8858X
8959Y
905AZ
915B[
925C\
935D]
945E^
955F_
DecHexChar
9660`
9761a
9862b
9963c
10064d
10165e
10266f
10367g
10468h
10569i
1066Aj
1076Bk
1086Cl
1096Dm
1106En
1116Fo
11270p
11371q
11472r
11573s
11674t
11775u
11876v
11977w
12078x
12179y
1227Az
1237B{
1247C|
1257D}
1267E~
1277FDEL

When the decoded text looks wrong

Three encoding problems cause garbled output:

  1. Wrong encoding selected. ASCII mode shows a dot or question mark for any byte above 7F. Switch to UTF-8 to decode accented letters, symbols and emoji.
  2. Truncated multi-byte sequence. UTF-8 characters above U+007F use 2–4 bytes. Cutting the hex in the middle of a sequence produces the replacement character (�). Paste the complete hex string to fix it.
  3. Source used a different encoding. Some older systems store text as Latin-1 (ISO 8859-1), Windows-1252 or Shift-JIS. Those bytes decode wrongly as UTF-8. Identify the source encoding and convert to UTF-8 first.

Pick bytes and a decoder below to see each failure.

Hex to text use cases

Hex to text conversion applies in five areas of computing and security:

  1. Debugging and log analysis. Error logs and system dumps show raw data in hex. Decoding it reveals error messages, file paths and the user input that caused the fault.
  2. Network packet analysis. Tools such as Wireshark show packet payloads in hex. Converting the payload to text exposes HTTP headers, DNS queries, protocol messages and transmitted data.
  3. Data recovery and forensics. Recovering deleted files from a disk image means reading raw hex bytes. Decoding them reveals file headers, text fragments and metadata that help rebuild the data.
  4. Reverse engineering. Disassemblers and hex editors show binary files as hex. Converting selected byte ranges shows embedded strings, error messages and configuration values inside compiled programs.
  5. Cryptography and security. Encrypted payloads, hashes and digital signatures appear in hex. Converting the surrounding metadata and plaintext parts helps analysts understand the data structure.

Each button below loads a real-looking sample from one of these areas.

Hex to text in programming

Most languages decode hex to text with built-in functions. Pick a language to see the call and its output for your hex string.

Python

import binascii
hex_string = "48656c6c6f20576f726c64"
text = binascii.unhexlify(hex_string).decode('utf-8')
print(text)  # Hello World

Python’s binascii.unhexlify() converts the hex string to bytes, and .decode('utf-8') turns the bytes into a string. For the full guide, see hex to decimal in Python.

JavaScript

const hex = "48656c6c6f20576f726c64";
const bytes = hex.match(/.{2}/g).map(b => parseInt(b, 16));
const text = new TextDecoder().decode(new Uint8Array(bytes));
console.log(text); // Hello World

Split the hex string into pairs, parse each pair as a base-16 integer, and pass the byte array to TextDecoder. For the full guide, see hex to decimal in JavaScript.

Java

import java.util.HexFormat;
public class Main {
    public static void main(String[] args) {
        String hex = "48656c6c6f20576f726c64";
        byte[] bytes = HexFormat.of().parseHex(hex);
        String text = new String(bytes, java.nio.charset.StandardCharsets.UTF_8);
        System.out.println(text); // Hello World
    }
}

Java 17’s HexFormat parses the hex string into a byte array, and the String constructor with the UTF-8 charset decodes the bytes. For the full guide, see hex to decimal in Java.

Other languages

LanguageMethodExampleResult
Csscanf and a loopParse each pair with sscanf(pair, "%2hhx", &byte)Byte array, then text
Excel=HEX2DEC() and CHAR()=CHAR(HEX2DEC("48"))"H"
Bashxxd -r -pecho "48656c6c6f" | xxd -r -pHello
PowerShell[Convert]::ToByte()Pairs, then bytes, then [Text.Encoding]::UTF8.GetString()Hello

Each language has its own guide on this site: C, Excel and Linux and Bash.

Hex to text conversion tips

Four practices prevent errors and speed up the process:

  1. Verify the encoding before converting. Check whether the source data uses ASCII, UTF-8, Latin-1 or another encoding. The wrong one produces garbled text.
  2. Remove delimiters first. Strip spaces, commas, colons, 0x prefixes and \x escapes from the hex string before decoding. The converter above does this for you.
  3. Check for odd digit counts. A valid hex byte string has an even number of digits. An odd count means a digit is missing, usually at the start or end of a cut-off dump.
  4. Validate the output. After decoding, scan the text for replacement characters (�) or unexpected symbols. They point to an encoding mismatch or damaged bytes.

Frequently asked questions

How do I convert hex to text?
Split the hex string into pairs of two digits, convert each pair to its decimal value, and look up the character in the ASCII or UTF-8 table. For example, hex 48 = decimal 72 = the letter H. The converter above does this for hex input of any length.
How do I convert 41 hex to text?
Hex 41 = decimal 65 = the letter A. The calculation is 4 × 16 + 1 = 65, and ASCII code 65 is the uppercase letter A.
How do I convert 30 hex to text?
Hex 30 = decimal 48 = the digit character “0”. The ASCII digits 0–9 sit at hex 30–39. Hex 30 is the character “0”, not the number zero.
What does the hexadecimal FF mean?
Hex FF = decimal 255, the largest value one byte can hold. FF is above the ASCII range of 00–7F, so it has no ASCII character. In Latin-1 it is the character ÿ. In a colour code, FF in one channel means full intensity (255 out of 255).
What is the ASCII equivalent of the 0D hex code?
Hex 0D = decimal 13 = the carriage return (CR) control character. CR moves the cursor to the start of the line. Windows line endings use CR LF (0D 0A), while Unix uses LF (0A) alone.
What comes after the hexadecimal FF?
Hex 100, which equals decimal 256. FF is the largest two-digit hex value (255). Adding 1 gives 100, the smallest three-digit hex value. It follows the same carry-over rule as decimal 99 + 1 = 100.
What is the difference between hex and binary?
Hex is base 16 (digits 0–F) and binary is base 2 (digits 0 and 1). Each hex digit maps to exactly 4 bits, so hex is a compact way to write binary data. Hex FF = binary 11111111. To convert between them, use the hex to binary converter.
How do I convert hex to decimal?
Multiply each hex digit by its power of 16 and add the results. For hex 4A: 4 × 16 + 10 = 74. For the full method with worked examples, use the hex to decimal converter.
Can hex values contain spaces?
Yes. Spaces are formatting, not data. Hex dumps often separate bytes with spaces (48 65 6C) or colons (48:65:6C) for readability. Remove all separators before decoding, or use a converter that strips them for you.
What does the 0x prefix mean?
0x marks a number as hexadecimal in languages such as C, Python, JavaScript and Java. The prefix avoids confusion with decimal: 0x10 is hex 10 (decimal 16), not decimal 10. The converter accepts input with or without 0x.
How large can a hex number be?
A hex string can be any length. Each pair of hex digits adds one byte. Most programming languages limit integers to 64 bits (16 hex digits), but hex strings used as data (file contents, hashes, encryption keys) have no fixed limit. A SHA-256 hash is 64 hex digits (32 bytes), and files can run to millions of bytes.