This worked for me.

$ echo -n 54657374696e672031203220330 | xxd -r -p
Testing 1 2 3$

echo -n prevents a newline from being added to the end

-r tells it to convert hex to ascii as opposed to its normal mode of doing the opposite

-p tells it to use a plain format.

Answer from funroll on Stack Overflow
Discussions

bash - How to convert hex to ASCII characters in the Linux shell? - Stack Overflow
Let's say that I have a string 5a. This is the hex representation of the ASCII letter Z. I need to find a Linux shell command which will take a hex string and output the ASCII characters that the hex More on stackoverflow.com
๐ŸŒ stackoverflow.com
convert hex to ascii text
Is there a command to convert hex characters into their respective ascii values? More on unix.com
๐ŸŒ unix.com
5
0
October 19, 2017
Ascii/Hex convert in bash - Stack Overflow
I'm now doing it this way: [root@~]# echo Aa|hexdump -v 0000000 6141 000a 0000003 [root@~]# echo -e "\x41\x41\x41\x41" AAAA But it's not exactly behaving as I wanted,... More on stackoverflow.com
๐ŸŒ stackoverflow.com
October 31, 2012
Convert column from hex to ascii
I can modify the column using awk but I can't pass that value to another command to do the convertion. Either you can do whatever you want, or this is homework. If so, please say so. Next, is this a Bash-only assignment, or can you use other languages? This is easy to do, but it would be much easier if you would post the assignment's hexadecimal source so I could show the conversion of your example text. Meanwhile, here's a sample: #!/usr/bin/env bash ascii="" for c in 54 68 69 73 20 69 73 20 61 20 74 65 73 74 2e; do ascii+="\x$c" done echo -e $ascii Output: This is a test. More on reddit.com
๐ŸŒ r/bash
21
5
July 25, 2019
๐ŸŒ
Linux Handbook
linuxhandbook.com โ€บ convert-hex-ascii
Convert Hex to ASCII Characters in Linux Command Line
July 27, 2025 - Here, command option -r is used to convert hex code to ASCII, and -p is used to print the plain text. sagar@itsfoss:~$ echo 4c696e757868616e64626f6f6b20313233 | xxd -r -p Linuxhandbook 123sagar@itsfoss:~$
๐ŸŒ
LabEx
labex.io โ€บ tutorials โ€บ linux-how-to-convert-hex-to-ascii-in-bash-431151
How to convert hex to ASCII in bash | LabEx
xxd is a powerful tool for hex conversion in Linux: ## Convert hex to ASCII echo -n "48 65 6c 6c 6f" | xxd -r -p ## Output: Hello ## Convert ASCII to hex echo -n "Hello" | xxd -p ## Output: 48656c6c6f
๐ŸŒ
UbuntuMint
ubuntumint.com โ€บ home โ€บ linux commandline tips โ€บ how to convert hex to ascii characters in linux
How to Convert Hex to ASCII Characters in Linux
July 24, 2023 - The command option -r converts the Hex characters to ASCII and command option -p prints the outcome in plain text. The final echo command produces a newline on the Linux terminal.
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ article โ€บ convert-hex-to-ascii-characters-in-the-linux-shell
Convert Hex to ASCII Characters in the Linux Shell
March 17, 2026 - Converting hex to ASCII in Linux can be accomplished through multiple command-line tools, each with distinct advantages. The printf and xxd methods are most straightforward for simple conversions, while perl and sed offer more flexibility for complex pattern processing.
Find elsewhere
๐ŸŒ
SysTutorials
systutorials.com โ€บ convert-hex-to-ascii-using-xxd
Converting Hex To ASCII With Xxd - SysTutorials
April 12, 2026 - The xxd -r -p combination remains the fastest and most portable way to convert hex strings to ASCII on the command line.
๐ŸŒ
DEV Community
dev.to โ€บ carlyraejepsenstan โ€บ converting-hex-to-text-the-bash-way-1483
Converting Hex to Text - the Bash Way - DEV Community
March 18, 2022 - Next, we know that you can convert a hex byte into ASCII (or text) by using echo like this:
๐ŸŒ
Linux Handbook
linuxhandbook.com โ€บ tools โ€บ hex-ascii-converter
Free Online Hex to ASCII Converter
July 27, 2025 - Here are various ways for converting Hex to ASCII characters in the Linux command line and bash scripts.
๐ŸŒ
Linux Today
linuxtoday.com โ€บ home โ€บ how to convert hex to ascii characters in linux
How to Convert Hex to ASCII Characters in Linux | Linux Today
May 26, 2022 - A hexadecimal numbering system is ideal for large digital systems, but not for everything. Learn to convert hex to ASCII characters in Linux here.
๐ŸŒ
Unix Community
community.unix.com โ€บ shell programming and scripting
Converting hex to ascii/decimal - Shell Programming and Scripting - Unix Linux Community
March 31, 2011 - I am writing a bash script to do some parsing on a log and I am running into a problem when it comes to converting only certain sections of the file from hex to ascii or hex to decimal. Data Example: The hex values afโ€ฆ
๐ŸŒ
idroot
idroot.us โ€บ home โ€บ how to convert hex to ascii characters on linux
How To Convert Hex To ASCII Characters on Linux - idroot
October 8, 2025 - Most utilities discussed in this guide come pre-installed with Linux distributions. The xxd command typically ships with the vim-common package, while printf and echo are built-in bash commands available on every system.
๐ŸŒ
Reddit
reddit.com โ€บ r/bash โ€บ hex to ascii conversion - noob question
r/bash on Reddit: Hex to ASCII conversion - noob question
December 12, 2024 -

Hi all, freshly joined noobie here :)

I am currently working as a jr embedded software engineer, and have been struggling with data collection at runtime of the application.
I'm using a debugger that keeps sending a variable's hex value to the host pc via usb, but since this value is interpreted as ASCII, I see invalid symbols on the terminal.

As naive as it may sound, my question is: is there a way with a script to "get in between" the debugger and the terminal on the host pc to convert these hex values in their ASCII counterpart, so they are displayable "correctly"? (like, if I send 0x0123 I'd like the terminal to show "291" instead of the symbols associated with 0x01 and 0x23).
Extra question: do you have any suggestion on material I can study on to get a solid knowledge of bash scripting in general, too?

Thank you for your time and your patience, I hope I didn't sound too stupid haha.

๐ŸŒ
Reddit
reddit.com โ€บ r/linuxquestions โ€บ is there a way to get a ascii character's hex code via cli
r/linuxquestions on Reddit: Is there a way to get a ascii character's hex code via cli
January 31, 2023 -

pain

having 39 ln commands in a row makes me scream inside

If you dont know what this is, I'm linking ncurses terminfo directories to their ascii hex equivalents for compatibility with some software that requires it to be setup like that. You can see what hex numbers correspond to what characters by writing them in a text file and opening it in a hex editor, what I need is a way to check a character's hex code via the command line.