# Convert app arg to Addr

**URL:** https://forum.algorand.co/t/convert-app-arg-to-addr/6347
**Category:** General
**Tags:** teal, smart-contracts
**Created:** [March 27, 2022, 4:56pm UTC](https://forum.algorand.co/t/convert-app-arg-to-addr/6347 "2022-03-27T16:56:54Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ncoin](https://avatars.discourse-cdn.com/v4/letter/n/8e8cbc/32.png) [@ncoin](https://forum.algorand.co/u/ncoin)
#### Post date: [March 27, 2022, 4:56pm UTC](https://forum.algorand.co/t/convert-app-arg-to-addr/6347/1 "2022-03-27T16:56:55Z")

</div>

Lets say I have an app arg `Txn[0].application_args[0]`. I want to store local storage for an account address contained in the app arg. How can I convert Bytes() to Addr()?

---

<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: [March 27, 2022, 7:17pm UTC](https://forum.algorand.co/t/convert-app-arg-to-addr/6347/2 "2022-03-27T19:17:27Z")

</div>

Internally, an address is just a 32-byte array.  
So just ensure that the first argument is the 32 bytes of the address (without checksum and with base32 conversion).

See [Overview - Algorand Developer Portal](https://developer.algorand.org/docs/get-details/accounts/) (where the actual 32-byte address is called “public key” in this document) and [How to convert public key back to address in js sdk - #3 by fabrice](https://forum.algorand.co/t/how-to-convert-public-key-back-to-address-in-js-sdk/3643/3)

---

<div class="post-metadata">

### Author: ![casper](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.algorand.co/casper/32/1612_2.png) [@casper](https://forum.algorand.co/u/casper)
#### Post date: [March 29, 2022, 12:28am UTC](https://forum.algorand.co/t/convert-app-arg-to-addr/6347/3 "2022-03-29T00:28:14Z")

</div>

I’m not sure the above will work because the address, if passed in as an arg, will need to be encoded and subsequently decoded in TEAL, which I’m not sure is possible yet. I would instead supply the address to the accounts array and store that in local/global state.

---

<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: [March 29, 2022, 1:39am UTC](https://forum.algorand.co/t/convert-app-arg-to-addr/6347/4 "2022-03-29T01:39:53Z")

</div>

You need to only use “decoded” 32-byte address as application arguments and state variables.  
Everything in the chain itself uses this format.  
The encoded addresses (like `XFYAYSEGQIY2J3DCGGXCPXY5FGHSVKM3V4WCNYCLKDLHB7RYDBU233QB5M`) are only for display.

The SDK must do all the encoding/decoding.
