2

I am trying to use xxd command to convert string to hex. I have typed this command in cmd in windows xxd -p <<< "Hello world". But I have got this in my cmd 'xxd' is not recognized as an internal or external command, operable program or batch file.

How can I use xxd in cmd in windows?

Thanks.

Ulrich Eckhardt
  • 16,572
  • 3
  • 28
  • 55
Sara
  • 113
  • 1
  • 1
  • 8
  • 1
    Find some `xxd` and install it. – iBug Dec 25 '18 at 08:59
  • Stack Overflow is a site for programming and development questions. You should use another site on the [Stack Exchange network](https://stackexchange.com/sites) for this question. – jww Dec 25 '18 at 09:00
  • Write it in what? You can write a quick hex-converter in PowerShell in a few lines. – David C. Rankin Dec 25 '18 at 10:14
  • Not a programming question. Duplicate of https://stackoverflow.com/posts/13182222/revisions which was migrated to SuperUser as https://superuser.com/questions/497953/convert-hex-dump-of-file-to-binary-program-file-on-windows – Raymond Chen Dec 25 '18 at 16:41

6 Answers6

9

Use VIM for this

https://ftp.nluug.nl/pub/vim/pc/gvim73_46_s.zip

C:\Program Files (x86)\Vim\vim74>.\xxd -v

Source: https://superuser.com/a/638850

wuseman
  • 1,259
  • 12
  • 20
8

You could use git-bash to do that if you have installed it.

example

Luk Aron
  • 1,235
  • 11
  • 34
1

These days the full linux kernel is made available and officially supported by windows via WSL. Once installed, a program like Windows Terminal can be used to execute linux commands.

chantey
  • 4,252
  • 1
  • 35
  • 40
0

Short answer is you probably can't because it's a UNIX command...

What you can do is use GnuWin32/MinGW/CygWin, which are ports of Linux GNU utilities fro Windows.

Read more about them here: Difference between GNUWin32 and cygwin

0

See this utility clone.

https://sourceforge.net/projects/xxd-for-windows/

The operation is similar. To see in hexadecimnal use "xxd file.txt", to see in binary use "xxd -b file.txt".

0

If you have powershell version 5.0 or later, you can use the powershell built-in function Format-Hex

$ Format-Hex '.\your-file-name'

It is not as powerfull as xdd but you can run it natively in Windows

A.Casanova
  • 555
  • 4
  • 16