Ascii to Hex Converter

Our ASCII to Hex Converter turns ASCII text into hexadecimal values quickly. Learn how ASCII maps to hex, convert text manually, check examples, copy results, and see UTF-8 limits.
From
Text—
Binary—
Hexadecimal—
Decimal—
Octal—
ASCII Codes—
Recent
Nothing here yetYour recent activity will appear here

What Is ASCII Text?

ASCII is a character coding standard that gives letters, numbers, and symbols values from 0 to 127. Each ASCII character has a decimal value, which you can convert into a hexadecimal value. This makes text easier to store, inspect, and understand in computer systems.

What Is Hexadecimal?

Hexadecimal is a base-16 number system. It uses digits 0 to 9 and letters A to F. Computers use hex to show bytes in a shorter form, making digital values easier to read. One hex digit represents four binary bits. Each pair of hex digits can show one byte of data.

ASCII to Hex Converter showing ASCII characters converted to hexadecimal values.

How can you use our ASCII to Hex Converter?

Our ASCII to Hex Converter turns ASCII text into hexadecimal without manual math. Enter text, view the hex result, and copy it for study, coding, assignments, or quick reference. The tool keeps each character in order, so the hex string matches your original ASCII text.

Step 1

Enter Your ASCII Text

Type or paste the ASCII text you want to convert.

Step 2

View Hex Result

Get the hexadecimal value instantly from your ASCII text.

Step 3

Copy Result

Copy the converted hex value for future use.

How to Convert ASCII to Hex Manually

Convert ASCII to Hex by finding each character's decimal value, then changing it to base 16.

Formula

Hex=decimalvalueconvertedtobase 16Hex = decimal value converted to base\ 16

Step by step Guide

  1. Choose an ASCII character.
  2. Find its ASCII decimal value.
  3. Divide the value by 16.
  4. Write the quotient and remainder as hex digits.
  5. Combine the digits to get the hex value.
  6. Repeat for each character.

Practical Example

A has ASCII value 65. 65÷16=465 ÷ 16 = 4 remainder 11, so A becomes 4141 in hex. For Hi, H is 72 = 4848 and i is 105 = 6969. So Hi becomes 48 6948\ 69.

ASCII to Hex Conversion Table

Character

ASCII Decimal

Hex

Space

32

20

0

48

30

1

49

31

2

50

32

3

51

33

4

52

34

5

53

35

6

54

36

7

55

37

8

56

38

9

57

39

A

65

41

B

66

42

C

67

43

D

68

44

E

69

45

F

70

46

G

71

47

H

72

48

I

73

49

J

74

4A

K

75

4B

L

76

4C

M

77

4D

N

78

4E

O

79

4F

P

80

50

Q

81

51

R

82

52

S

83

53

T

84

54

U

85

55

V

86

56

W

87

57

X

88

58

Y

89

59

Z

90

5A

a

97

61

b

98

62

c

99

63

d

100

64

e

101

65

f

102

66

g

103

67

h

104

68

i

105

69

j

106

6A

k

107

6B

l

108

6C

m

109

6D

n

110

6E

o

111

6F

p

112

70

q

113

71

r

114

72

s

115

73

t

116

74

u

117

75

v

118

76

w

119

77

x

120

78

y

121

79

z

122

7A

Note: ASCII values use decimal codes from 0 to 127. Convert each character separately, then join the hex values in the same order as the original text.

ASCII to Hex Conversion (Programming Examples)

You can also convert ASCII characters to hexadecimal with code. These examples work with basic ASCII text and produce two-digit hexadecimal values.

JavaScript ASCII to Hex

const text = "Hi";

const hex = [...text]
.map(char => char.charCodeAt(0).toString(16).padStart(2, "0"))
.join(" ");

console.log(hex.toUpperCase());
// 48 69

This code gets each ASCII character, finds its decimal code, and changes it to hexadecimal.

Python ASCII to Hex

text = "Hi";

hex_value = " ".join(f"{ord(char):02X}" for char in text);

print(hex_value)
# 48 69

Python uses ord() to get the ASCII value and formats it as a two-digit hexadecimal value.

Java ASCII to Hex

String text = "Hi";
StringBuilder hex = new StringBuilder();

for (char c : text.toCharArray()) {
hex.append(String.format("%02X ", (int) c));
}

System.out.println(hex.toString().trim());
// 48 69

Java converts each ASCII character into its decimal code before formatting it as hex.

PHP ASCII to Hex

$text = "Hi";
$hex = "";

for ($i = 0; $i < strlen($text); $i++) {
$hex .= sprintf("%02X ", ord($text[$i]));
}

echo trim($hex);
// 48 69

PHP uses ord() to read each ASCII value and sprintf() to format the hexadecimal output.

Common ASCII to Hex Conversion Mistakes

Common mistakes include using the wrong ASCII value, skipping spaces, mixing decimal with hexadecimal, or treating Unicode characters as ASCII. Check each character before copying the final hex string. Remember that a space has ASCII value 32 and hex value 20.

Frequently Asked Questions

These answers cover common ASCII to Hex questions about text, characters, ASCII limits, Unicode, UTF-8, and safe converter use.