<p>Jameson Lopp has a tool on his github that performs this function.</p>
<p>Paste your xpub into the text box, and select the type you want from the drop-down and click convert.</p>
<p>Demo: <a href="https://jlopp.github.io/xpub-converter/" rel="noreferrer">https://jlopp.github.io/xpub-converter/</a></p>
<p>Source: <a href="https://github.com/jlopp/xpub-converter" rel="noreferrer">https://github.com/jlopp/xpub-converter</a></p>

CC BY-SA 4.0
2024-03-29T20:44:20.997Z
I see that I already upvoted here, but I only just now cloned that repo and tried it out, and it seemed to be what I wanted. Now I have a zpub for my Ledger BTC and can check my balance at https://www.blockonomics.co. Thanks!
Ryan
CC BY-SA 4.0
2020-12-15T02:09:26.560Z
2020-12-15T02:09:26.560Z
m1xolyd1an
<p>There's a command line electrum option convert_xkey. If you're on linux or macosx you can see the documentation for it via <code>electrum help convert_xkey</code>. Alternatively you can use the console tab of electrum on all operating systems to achieve the same result. For example <code>convert_xkey(xkey=&quot;xpub...&quot;,xtype=&quot;p2wpkh&quot;)</code> will convert from p2pkh to p2wpkh</p>

CC BY-SA 4.0
2020-12-15T04:17:26.063Z
2020-12-15T04:17:26.063Z
Abdussamad
<p>Blockonomics has a conversion tool that can convert xpub to ypub or zpub<br />
<a href="https://www.blockonomics.co/views/segwit_xpub_convert.html" rel="nofollow noreferrer">https://www.blockonomics.co/views/segwit_xpub_convert.html</a></p>

CC BY-SA 4.0
2021-09-15T18:46:31.977Z
2021-09-15T18:46:31.977Z
dark knight
<p>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.</p>
<ol>
<li><p>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 (<a href="https://unchained-capital.github.io/caravan/#/wallet" rel="nofollow noreferrer">https://unchained-capital.github.io/caravan/#/wallet</a>). I got a wallet with bc1 addresses...</p>
</li>
<li><p>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!</p>
</li>
<li><p>I then recreated the initial SegWit MultiSig wallet (from step 1) on Electrum, <strong>by actually connecting the same devices</strong>. I got the same bc1 addresses as Step 1. Nice.</p>
</li>
<li><p>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.</p>
</li>
<li><p>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: <a href="https://gyazo.com/b66d8788e62208a2bdd021fb6ce53bd7" rel="nofollow noreferrer">https://gyazo.com/b66d8788e62208a2bdd021fb6ce53bd7</a></p>
</li>
</ol>
<p>Is there a tool that performs the opposite functions, that converts an xPubs to a zPub?</p>
<p>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.</p>

<electrum><segregated-witness><multi-signature><xpub>
XPUB, YPUB, ZPUB Converter Tools
Jeremy Nau
# XPUB, YPUB, ZPUB Converter Tools

(Asked by: username_0 on 2020-12-14)

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.

**Tags:** electrum, segregated-witness, multi-signature, xpub


---

## 3 answers

### Answer by username_1 on 2020-12-15. Score: 5

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>

> **Comments:**
> **username_2**: I see that I already upvoted here, but I only just now cloned that repo and tried it out, and it seemed to be what I wanted. Now I have a zpub for my Ledger BTC and can check my balance at https://www.blockonomics.co. Thanks!  

---

### Answer by username_3 on 2020-12-15. Score: 4

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


---

### Answer by username_4 on 2021-09-15. Score: 3

Blockonomics has a conversion tool that can convert xpub to ypub or zpub  
<https://www.blockonomics.co/views/segwit_xpub_convert.html>


---

