RAX2(1)
π RAX2(1) β Radare2 Base Converter
okay so bestie, gather round, because rax2 is genuinely one of the most underrated glow-ups in the radare2 family and I need you to know about it. It's the Radare2 Base Converter, and it's about to become your main character tool. π
β¨ SYNOPSIS β¨
rax2 [-abcCdDeEfFhHijkKnoqrsStuUvwxXzZ] [[expr] ...]
πΈ DESCRIPTION πΈ
rax2 is a versatile calculator for numerical base conversions, string encoding/decoding, and data representation within Radare2 β and yes she does all of it. She supports C-string encoding, hexpairs, Base64, and a whole bunch of other formats. it's giving swiss army knife, no cap. π₯
the most common numerical bases, since we're being educated today:
- binary (base 2) β for direct machine code interaction, iykyk
- hexadecimal (base 16) β for memory addresses and compact data representation
- decimal (base 10) β for human-readable calculations and interpretations, aka the one you can actually read at 3am
π¦ OPTIONS π¦
-aβ Show ASCII table. the whole vibe check, laid out for you β¨-bbase β Force output mode (numeric base). your options are:fβ floating point2β binary3β ternary8β octal10β decimal16β hexadecimal
and listen, when you use it with -s and -e, it selects the word size in bits for endian-swapping hex input. valid word sizes are 8, 16, 32, and 64 bits. don't try anything else, she will not be amused π
-cβ Show hexadecimal C string from integer value-Cβ Dump stdin to C array in stdout. literally thexxdreplacement, she ate-dβ Print the result in decimal (base 10)-Dβ Decode the input data using base64-eβ Swap endianness. when paired with-s, it requires-bto specify the word size β no-b, no swap, that's the rule π«Ά-Eβ Encode the input data using base64-fβ Interpret the input number as a 32bit dword and display it using the IEEE 754 standard for floating point arithmetic. fancy fr fr-Fβ Read C strings from stdin and output in hexpairs. super useful to load shellcodes π-hβ Show usage help message-Hβ Convert a string into a hash-iβ Convert LONG to/from IP ADDRESS-jβ Show the output in json format, the same as the r2?j 0x804command-kβ Keep the same base as the input data. loyalty π-Kβ Show randomart key asciiart for values or hexpairs-nβ Append newline to the decoded output for human friendliness-oβ Convert from octal string to char (rax2 -o 162 62)-qβ Be quiet. Show less information or drop the superfluous details in the output. she's not mad, she's just quiet π€«-rβ Show the same output as the r2's? 0x804command. and when combined with-S(-rS) it will print r2 commands to write the actual binary into radare2. iconic behavior-sβ Convert from hex pairs string to character (rax2 -s 43 4a 50)-Sβ Convert from character to hex string (rax2 -S C J P)-tβ Convert epoch timestamp to human readable date format-uβ Convert given value to human readable units format-vβ Show version information-wβ Display the result as 16bit signed integer value-xβ Show hexpairs from integer value-Xβ Convert a bit stream (an arbitrary sequence of0and1of any length) to hexadecimal. the result can be larger than 64bits, so don't come for her about size π-zβ Convert from character string to binary (rax2 -z hello)-Zβ Convert from binary string to string (rax2 -Z 01000101)
π USAGE π
available variable types are, and I'm quoting this exactly because it's sacred:
int -> hex rax2 10
hex -> int rax2 0xa
-int -> hex rax2 -77
-hex -> int rax2 0xffffffb3
int -> bin rax2 b30
int -> ternary rax2 t42
bin -> int rax2 1010d
ternary -> int rax2 1010dt
float -> hex rax2 3.33f
hex -> float rax2 Fx40551ed8
oct -> hex rax2 35o
hex -> oct rax2 Ox12 (O is a letter)
bin -> hex rax2 1100011b
hex -> bin rax2 Bx63
ternary -> hex rax2 212t
hex -> ternary rax2 Tx23
raw -> hex rax2 -S < /binfile
hex -> raw rax2 -s 414141
π₯ EXAMPLES π₯
with no arguments, rax2 reads values from stdin. you can also pass one or more values as arguments, whatever fits your vibe:
$ rax2 33 0x41 0101b
0x21
65
0x5
you can do 'unpack' hexpair encoded strings easily. so easy. effortless. π¦
$ rax2 -s 41 42 43
ABC
swap the byte order of each 32-bit word in a hex stream:
$ printf 1122334455667788 | rax2 -esb 32 | rax2 -S
4433221188776655
it supports some math operations, because of course she does:
$ rax2 1+1 "0x5*101b+5"
2
30
encode and decode binary file using base64:
$ rax2 -E < /bin/ls > ls.b64
$ rax2 -D < ls.b64 > ls
$ cmp /bin/ls ls && echo $?
0
use -z/-Z to convert between binary and string:
$ rax2 -z hello
01101000011001010110110001101100011011000000000000000000
$ rax2 -Z 01101000011001010110110001101100011011000000000000000000
hello
hash strings:
$ rax2 -H linux osx
linux: 0x5ccc1772
osx: 0x099bf94f
work with IP addresses:
$ rax2 -i 127.0.0.1
0x0100007f
$ rax2 -i 0x0100007f
127.0.0.1
it is a very useful tool for scripting, so you can read floating point values, or get the integer offset of a jump or a stack delta when analyzing programs. honestly? scripting queen. π
π§ ENVIRONMENT π§
rax2 does not use any environment variables. zero. none. she's low maintenance like that π
β SEE ALSO β
πΈ WWW πΈ
π AUTHORS π
pancake <pancake@nopcode.org>
okay bestie that's the whole page, go forth and convert everything. mwah π
this edition dropped Aug 22, 2026 and lives in the RAX2(1) manual β see you in the next one, love u π«Ά
π¦ where this page comes from
- arch rolling: radare2 6.2.2-1 Β· GPL-3.0-only AND LGPL-3.0-only
- nixpkgs unstable: radare2 6.2.4
- opensuse-leap 16.0: radare2 6.2.2-bp160.1.1 Β· GPL-3.0-only AND LGPL-3.0-only
- opensuse-leap 16.0: radare2 6.2.2-bp160.1.1 Β· GPL-3.0-only AND LGPL-3.0-only
- opensuse-leap 16.0: radare2 6.2.2-bp160.1.1 Β· GPL-3.0-only AND LGPL-3.0-only
- opensuse-leap 16.0: radare2 6.2.2-bp160.1.1 Β· GPL-3.0-only AND LGPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms