Convert Ascii to Binary

Published: 2018-09-20 22:12:39 +0000
Categories: BASH,




Simple one liner to dump an Ascii string out in binary


echo $MESSAGE | perl -lpe '$_=unpack"B*",$_'

# To convert back
echo $BINARY | perl -lpe '$_=pack"B*",$_'

Usage Example

$ echo Hello World | perl -lpe '$_=unpack"B*",$_'

$ echo 0100100001100101011011000110110001101111001000000101011101101111011100100110110001100100 | perl -lpe '$_=pack"B*",$_'
Hello World


Ascii, Binary, Convert,

Latest Posts

Setting Git author details for a single repo (Git)
Checking Virtual Machine Resource Allocations with Libvirt (BASH)
Rsync over SSH with a custom port (BASH)
Remotely backing up PFsense Configuration (BASH)
FFMPEG: Converting RMVB to X264 MP4 (BASH)
Recursively print table (print_r equivalent) (LUA)
Bulk Delete Comments from (Self-Hosted) JIRA Issues (Misc)
Add a static entry to the ARP table (BASH)
SSL Cipher Hex codes to Human Readable Names (Misc)
Convert Ascii to Binary (BASH)

Copyright © 2019 Ben Tasker | Sitemap | Privacy Policy
Available at and snippets.6zdgh5a5e6zpchdz.onion