A fast, cross-platform base converter and expression calculator written in Rust.
- Smart base parsing:
0xhex,0bbinary,0ooctal,hsuffix hex - Expression evaluation with operators and aliases (
and,or,xor,shl,shr,x) - Color input
#RGB/#RRGGBBwith preview - Interactive REPL with variables and history
- Output format toggles and one-line mode
- Bilingual messages (auto-detect,
--langoverride)
cargo build --releaseBinary will be in target/release/hex (or hex.exe on Windows).
hex [FLAGS/OPTIONS] [EXPRESSION]hex 0x15
hex 0x15+100
hex 0x1A or 0b100 --bin
hex "0x50 & 0xFF"
hex --dec 0 --bin 1010
hex --oneline 255
hex "#FF5733"-b, --bin[=0|1]show/hide binary-o, --oct[=0|1]show/hide octal-a, --allshow all formats (Dec/Hex/Oct/Bin/Char)--dec[=0|1]show/hide decimal--hex[=0|1]show/hide hexadecimal-c, --charshow character (single byte)-l, --onelineprint in one line-i, --interactiveenter REPL--lang <LANG>en/cn/zh/zh-CN-h, --helphelp-V, --versionversion
Start by running hex or hex -i.
Commands:
:bin [on|off],:oct [on|off],:dec [on|off],:hex [on|off],:char [on|off]:oneline [on|off]:all:vars:?/:help:quit/:q
Examples:
hex > let a = 0xFF
hex > a + 1
hex > _ * 2
MIT. See LICENSE.