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
🌐
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.
Discussions

bash - How to convert hex to ASCII while preserving non-printable characters - Stack Overflow
The first xxd command converts hex to ASCII. The second converts ASCII back to hex. More on stackoverflow.com
🌐 stackoverflow.com
Ascii/Hex convert in bash - Stack Overflow
If your system has them, hd (or ... hex output. You can use od -t x1c to show both the byte hex values and the corresponding letters. If you have xxd (which ships with vim), you can use xxd -r to convert back from hex (from the same format xxd produces).... More on stackoverflow.com
🌐 stackoverflow.com
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
How do you "convert" ascii "hex" data into actual hex, and how can you insert it into a binary file at a specific offset?
You can use vi,emacs, others for this :) but it's not much fun. dd and od are the fastest way without finding a special program to do it. http://www.unix.com/unix-advanced-expert-users/22755-modifying-binary-file-editing-hex-values.html More on reddit.com
🌐 r/linux4noobs
22
14
June 7, 2013
🌐
Baeldung
baeldung.com › home › scripting › convert hex to ascii characters in the linux shell
Convert Hex to ASCII Characters in the Linux Shell | Baeldung on Linux
March 18, 2024 - Alternatively, we can use the dc command to convert a character from hex to ASCII. The dc stands for Desk Calculator. This command accepts the input in postfix notation form: ... P represents the Print command of dc. The xxd command can generate a hex dump from a given input or reverse a hex dump given as input...
🌐
Linux Handbook
linuxhandbook.com › convert-hex-ascii
Convert Hex to ASCII Characters in Linux Command Line
July 27, 2025 - echo 4c696e757868616e64626f6f6b20313233 | xxd -r -p · Here, command option -r is used to convert hex code to ASCII, and -p is used to print the plain text.
🌐
Archive.ph
archive.ph › Zq8v1
Converting Hex to ASCII Using xxd - SysTutorials
July 24, 2021 - If not writing to stdout, xxd writes into its output file without truncating it. Use the combination -r -p to read plain hexadecimal dumps without line number information and without a particular column layout. Additional Whitespace and line-breaks are allowed anywhere. Use upper case hex letters. Default is lower case. Now let’s see how to convert the hex string to ASCII string with the above example for the given hex string "6162636465666768696a6b6c6d6e6f707172737475767778797a0a".
🌐
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 - If you wish to convert the Hex characters to ASCII characters from a file, use the cat command and pipe the file to xxd command.
🌐
TutorialsPoint
tutorialspoint.com › article › convert-hex-to-ascii-characters-in-the-linux-shell
Convert Hex to ASCII Characters in the Linux Shell
November 21, 2022 - Use \x prefix to indicate hexadecimal values: $ printf '\x54\x75\x74\x6F\x72\x69\x61\x6C\x73\x20\x50\x6F\x69\x6E\x74' && echo '' ... The xxd command creates hex dumps or reverses them back to original format.
Find elsewhere
🌐
Ubuntu
manpages.ubuntu.com › jammy › man(1)
Ubuntu Manpage: xxd - make a hexdump or do the reverse.
xxd creates a hex dump of a given file or standard input. It can also convert a hex dump back to its original binary form. Like uuencode(1) and uudecode(1) it allows the transmission of binary data in a `mail-safe' ASCII representation, but has the advantage of decoding to standard output.
🌐
SysTutorials
systutorials.com › docs › linux › man › 1-xxd
Xxd (1) Linux Manual Page - SysTutorials
May 19, 2026 - xxd creates a hex dump of a given file or standard input. It can also convert a hex dump back to its original binary form. Like uuencode(1) and uudecode(1) it allows the transmission of binary data in a `mail-safe’ ASCII representation, but has the advantage of decoding to standard output.
🌐
LabEx
labex.io › tutorials › linux-how-to-convert-hex-to-ascii-in-bash-431151
How to convert hex to ASCII in bash | LabEx
... At LabEx, we understand the importance of mastering these fundamental encoding techniques for robust Linux system programming. xxd is a powerful tool for hex conversion in Linux: ## Convert hex to ASCII echo -n "48 65 6c 6c 6f" | xxd -r -p ## ...
🌐
Computer Hope
computerhope.com › unix › xxd.htm
Linux Xxd Command
June 1, 2025 - How to convert between marked locations. ... The xxd program takes a file or standard input and outputs a hex dump that uses only ASCII or EBCDIC (Extended Binary Coded Decimal Interchange Code) characters. This output hex dump can be safely emailed and reconstructed at the destination.
🌐
Readthedocs
hexrec.readthedocs.io › en › latest › _autosummary › hexrec.xxd.html
xxd - hexrec 0.5.1 documentation
March 7, 2024 - Emulation of the xxd utility · Mapping from integer to ASCII characters
🌐
RapidTables
rapidtables.com › convert › number › hex-to-ascii.html
Hex to String | Hex to ASCII Converter
Enter hex code bytes with any prefix / postfix / delimiter and press the Convert button (e.g. 45 78 61 6d 70 6C 65 21): * ASCII text encoding uses fixed 1 byte for each character.
🌐
Whoi
uop.whoi.edu › UOPinstruments › frodo › aer › twob_conversion.html
2B OZONE File Conversion Guide
at the prompt, xxd -r -p ozone2.hex ozone2.bin will convert the HEX file to binary · at the prompt, ./twobswab ozone2.bin ozone2.swb will do the byte swapping and create the intermediate file ozone2.swb · at the prompt, ./twobasc ozone2.swb ozone2.asc will create the formatted ASCII file ...
🌐
Rob Allen
akrabat.com › use-xxd-to-convert-to-hex
Use xxd to convert to hex – Rob Allen
July 23, 2024 - If you want to see the hex values of a file, the easiest way to do this is to use xxd. Given foo.txt that contains “This is some text!”: $ xxd foo.txt 00000000: 5468 6973 2069 7320 736f 6d65 2074 6578 This is some tex 00000010: 7421 0a t!. ...