Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there an app/script out there that can convert a series of bytes from hex to dec (if not, is there an easy way to achieve this in the command prompt in a few lines)?

03 01 9d f0 b4 05 01 67 40 20 00 6b ad
share|improve this question
up vote 1 down vote accepted

There are tons of online converters, like this one:

share|improve this answer
Thanks. That helped a lot. Appreciate it. – stanigator Jul 7 '11 at 22:42
-1 for just posting a link. This is a place for collecting knowledge, what happens if the link dies? – Nifle Jul 7 '11 at 23:47
@Nifle Use one of the thousands of others out there? The OP didn't ask for a lesson on Hexadecimal mathematics, just a one-off conversion. – Andrew Lambert Jul 8 '11 at 0:06
@Amazed: I think Nifle meant ones similar to the link you've included, but these thousands of others would be suffice (didn't know the keywords to search for them properly originally) – stanigator Jul 8 '11 at 7:41

.js script for cscript:

num = [];
for (i = 0; i < WScript.Arguments.Length; i++) {
    arg = WScript.Arguments(i);
    num.push(parseInt(arg, 16));
WScript.Echo(num.join(" "));

Batch script for cmd.exe:

@echo off & setlocal
set /a out=0x%1
    if "%~1"=="" goto :end
    set /a num=0x%1
    set out=%out% %num%
    goto :loop
share|improve this answer

If all you want is a string of hex to a string of decimal, then this tiny perl program will do it:

while(<>){s/(.\s*.)\s*/hex($1).' '/eg;print;}


68edcdec4e2c8eae8d2c8e2dedcd6e04d2042fedae52ceac04 ccedaecd8c042ccd8c046cedad0e8dac8eac8c048e0dac044a a82889046c0d2c8d8daccdecacc5042bedae4e04ee2dcd046c

./ < input.hex

It's forgiving about white space in the source and only looks for consecutive pairs of hex digits.

Just modify with sprintf, push, split etc to control output format

If you install perl on windows, then this will work on the command line:

perl -e "while(<>){s/(.\s*.)\s*/hex($1).' '/eg;print;}" < input.hex

Perl is amazing. Noone should be without it!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.