[[...]] [[... atoms ...]] [[... other pages ...]] % set hex 3A 3A % scan $hex %x decimal 1 % set decimal 58 '''Decimal to hex:''' format %4.4X $decimalNumber Notice that the ".4" part gives leading zeroes, and does '''not''' have to do with the fractional (right-of-the-point) part of the number. '''Character to hex''': format %4.4X [scan $c %c] Notice that "[[scan $c %c]]" only does what one wants with newer Tcl's, those since version 8.??