I was wondering if there are any good X,Y,Zpub converter tools that any of you are aware of. For instance, a tool that could convert an Xpub into the equivalent Zpub.

  1. I was inspired to ask this question, as I was playing around with multi-sig capabilities on both Electrum and Caravan. I created a Segwit MultiSig wallet on Caravan by inserting 3 Xpubs into the tool (https://unchained-capital.github.io/caravan/#/wallet). I got a wallet with bc1 addresses...

  2. I then tried to re-create that wallet with only the xPubs on Electrum (mimicking a scenario where I didn't have all the signor keys), but Electrum read the xPubs as legacy and generated standard P2SH 3xxx... addresses in the wallet, a completely set of addresses. Not what I was looking for!

  3. I then recreated the initial SegWit MultiSig wallet (from step 1) on Electrum, by actually connecting the same devices. I got the same bc1 addresses as Step 1. Nice.

  4. I opened the Electrum wallet data for the MS wallet and noticed that Zpubs were noted, rather then the xPubs I had seen in the wallet data from Caravan. Note: both of these wallets generate the same addresses depending on the tool used.

  5. I then put the zPubs into Caravan to try and recreate the same MS wallet using the Electrum data (which worked), and it automatically converted the zPubs from the Electrum wallet to xPubs with the note: https://gyazo.com/b66d8788e62208a2bdd021fb6ce53bd7

Is there a tool that performs the opposite functions, that converts an xPubs to a zPub?

This would give me comfort that I don't have to save both xPub and zPub wallet files! I could simply use either the Caravan or Electrum wallet file and be confident I could always derive the other format if needed.

3 Answers 3


Jameson Lopp has a tool on his github that performs this function.

Paste your xpub into the text box, and select the type you want from the drop-down and click convert.

Demo: https://jlopp.github.io/xpub-converter/

Source: https://github.com/jlopp/xpub-converter


There's a command line electrum option convert_xkey. If you're on linux or macosx you can see the documentation for it via electrum help convert_xkey. Alternatively you can use the console tab of electrum on all operating systems to achieve the same result. For example convert_xkey(xkey="xpub...",xtype="p2wpkh") will convert from p2pkh to p2wpkh


Blockonomics has a conversion tool that can convert xpub to ypub or zpub

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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