Nodes/ComfyUI ARG Toolkit/Hexadecimal to String Converter
ComfyUI Node

Hexadecimal to String Converter

Turn those hex scribbles back into readable text

By AzelusLightvale·Created 12 months ago·Updated about 10 hours ago· 1
Hexadecimal to String Converter
    • converted_txt
    textHello World!
    encoding_format
    other_encoding_format

    Half the messages in an ARG arrive as hex - 48656c6c6f20576f726c6421 doesn't look like anything until you decode it, and then it's "Hello World!". Hex2String is the node that does that conversion: paste the hex in, get the text out. It's the decode half of the pack's String2Hex pairing, and it's one of those tiny utility nodes you'll wire into every workflow that involves hidden text, because the output of ciphers and watermarks so often comes back as hex.

    How it works

    The mechanism is four operations in a row: strip any 0x prefixes, drop spaces, convert the hex pairs into bytes, then decode those bytes using your chosen character encoding. It's forgiving in the way a solver wants - 0x4865 0x6c6c and 48656c6c both decode fine - but it's not magical: the hex has to be well-formed, even-length, and decodable in the encoding you pick.

    The inputs that matter

    • text - the hex string. Accepts 0x prefixes and spaces, which covers the two most common ways hex gets pasted around.
    • encoding_format - the character encoding. The dropdown has utf-8, utf-16, utf-32, ascii, latin-1, cp1252, utf-8-sig, and Other. This is the input that bites people. Hex bytes are encoding-agnostic - 48 65 6c 6c 6f is "Hello" in ASCII, UTF-8, and latin-1 alike, but a two-byte encoding like utf-16 reads the same bytes completely differently. If the text comes out as garbage, the encoding is the first thing to question.
    • other_encoding_format - only used when you select Other. Type any encoding name Python's codecs module knows (e.g. shift_jis, utf-16-le).

    The output

    • converted_txt (STRING) - the decoded text. Wire it into a text display node, a Show Text, or straight into the next cipher in the chain.

    Installing it

    Part of the ComfyUI ARG Toolkit:

    cd ComfyUI/custom_nodes
    git clone https://github.com/AzelusLightvale/ComfyUI-ARG-Toolkit
    

    Restart ComfyUI, or install via ComfyUI Manager ("ComfyUI ARG Toolkit"). This node has no special dependencies - it's pure Python bytes.fromhex and decode().

    Where people get burned

    • Odd-length hex. Hex encodes bytes as pairs; a stray character leaves a dangling nibble and bytes.fromhex throws a ValueError. Double-check you're not missing a leading zero.
    • Wrong encoding. utf-8 is the default and the right call 95% of the time. If output shows replacement characters or mojibake, the hex was probably produced with a different encoding - try latin-1 or cp1252, which decode almost any byte sequence without error.
    • Decoding non-text. Hex that came from a binary file or an encrypted blob often isn't valid text in any encoding. If decoding keeps failing, the bytes may not be a message at all - yet.

    The underrated strength here is the Other escape hatch. When a puzzle intentionally uses an obscure encoding, this node is the only one in the pack that lets you throw any Python codec at the bytes. For the "text that was hex all along" moment, this is the node that ends the mystery.

    CategoryARG Toolkit/Utilities/Converter

    Inputs (3)

    NameTypeDefaultDescription
    textSTRINGHello World!
    encoding_formatCOMBOThe encoding format available for text, may yield different results when converting.
    other_encoding_formatoptSTRINGIf, for some reason, your chosen encoding format is not available in the dropdown, select "Other" in encoding_format and type in your encoding format here. Supports all format written in Python's `encoding` module.

    Outputs (1)

    NameTypeDescription
    converted_txtSTRING