# How to convert public key back to address in js sdk

**URL:** https://forum.algorand.co/t/how-to-convert-public-key-back-to-address-in-js-sdk/3643
**Category:** Uncategorized
**Created:** [June 30, 2021, 11:12am UTC](https://forum.algorand.co/t/how-to-convert-public-key-back-to-address-in-js-sdk/3643 "2021-06-30T11:12:07Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![murasame](https://avatars.discourse-cdn.com/v4/letter/m/e0b2c6/32.png) [@murasame](https://forum.algorand.co/u/murasame)
#### Post date: [June 30, 2021, 11:12am UTC](https://forum.algorand.co/t/how-to-convert-public-key-back-to-address-in-js-sdk/3643/1 "2021-06-30T11:12:07Z")

</div>

I Convert an address to publick key to send to the application.

How to convert it back after it send to the application as a global state?

I get this global state as a string like “ZXUc/psAtm6K6AOMpvytibbSa8H6WFc6O8XTp/rHuEE=”

And the application id is 17990232.  
I tried so many way to convert it back, all. failed.

---

<div class="post-metadata">

### Author: ![scholtz](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.algorand.co/scholtz/32/864_2.png) [@scholtz](https://forum.algorand.co/u/scholtz)
#### Post date: [June 30, 2021, 12:47pm UTC](https://forum.algorand.co/t/how-to-convert-public-key-back-to-address-in-js-sdk/3643/2 "2021-06-30T12:47:13Z")

</div>

Is this what you are looking for?

ZXUc/psAtm6K6AOMpvytibbSa8H6WFc6O8XTp/rHuEE= is base64 format of the address… just put it to base32, and that is your address you are looking for

---

<div class="post-metadata">

### Author: ![fabrice](https://avatars.discourse-cdn.com/v4/letter/f/5fc32e/32.png) [@fabrice](https://forum.algorand.co/u/fabrice)
#### Post date: [June 30, 2021, 4:07pm UTC](https://forum.algorand.co/t/how-to-convert-public-key-back-to-address-in-js-sdk/3643/3 "2021-06-30T16:07:25Z")

</div>

In command line:

```bash
$ base64 -d <<< ZXUc/psAtm6K6AOMpvytibbSa8H6WFc6O8XTp/rHuEE= | base32
MV2RZ7U3AC3G5CXIAOGKN7FNRG3NE26B7JMFOOR3YXJ2P6WHXBAQ====
MV2RZ7U3AC3G5CXIAOGKN7FNRG3NE26B7JMFOOR3YXJ2P6WHXBAQ====

```

Note that addresses have a checksum at the end, which the above does not have.

You can do the conversion with checksum with this python one-liner in console:

```bash
$ python3 -c 'import base64; import algosdk; print(algosdk.encoding.encode_address(base64.b64decode("ZXUc/psAtm6K6AOMpvytibbSa8H6WFc6O8XTp/rHuEE=")))'
MV2RZ7U3AC3G5CXIAOGKN7FNRG3NE26B7JMFOOR3YXJ2P6WHXBA4IGKRJ4

```

You need to install Python and the Python Algorand SDK beforehand:

```bash
$ python3 -m pip install py-algorand-sdk

```

JS SDK has similar functions.
