# How to translate principal to account-id in ledger canister

**URL:** <https://forum.dfinity.org/t/how-to-translate-principal-to-account-id-in-ledger-canister/8592>\
**Category:** Developers\
**Tags:** in-progress\
**Created:** [November 15, 2021, 9:20am UTC](https://forum.dfinity.org/t/how-to-translate-principal-to-account-id-in-ledger-canister/8592 "2021-11-15T09:20:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pyd](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pyd](https://forum.dfinity.org/u/pyd)\
**Post date:** [November 15, 2021, 9:20am UTC](https://forum.dfinity.org/t/how-to-translate-principal-to-account-id-in-ledger-canister/8592/1 "2021-11-15T09:20:52Z")

</div>

i want to know how to translate a principal into an account-id. And the principal in [https://nns.ic0.app/](https://nns.ic0.app/) is derive from the host “[https://nns.ic0.app/](https://nns.ic0.app/)”?

---

<div class="post-metadata">

**Author:** ![levi](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/levi/32/22608_2.png) [@levi](https://forum.dfinity.org/u/levi)\
**Post date:** [November 15, 2021, 4:47pm UTC](https://forum.dfinity.org/t/how-to-translate-principal-to-account-id-in-ledger-canister/8592/2 "2021-11-15T16:47:36Z")

</div>

> <https://github.com/levifeldman/ic_tools_dart/blob/184ce0f54c518661e6a2b6009780c3f85cc6672f/lib/src/common.dart#L55-L70>
