Skip to main content
On this page, the main issues of interaction with the addresses are described:
  • how to create and parse;
  • how to check the validity;
  • how to convert from one format to another.

Using online converter

The best user-friendly online parser and address converter in TON blockchain is TON Address tool. If the address is entered in any format, the system will provide all possible formats for the address, provided that it is entered correctly. Otherwise, a warning will be displayed indicating that the address is invalid.

Using SDK

There are at least four SDKs for interacting with TON blockchain, written in You can use any of them, including for working with addresses. However, we focus here on the most used one: the one written in TypeScript. Namely, we examine ton-core address module. The internal addresses are represented as instances of the Address class. You can access it in your favorite IDE using the following import.
As for the external addresses, they are represented as instances of the ExternalAddress class. Similarly, you can access it as follows.

Create, parse, and convert addresses

The creation is simple.
You can parse the internal addresses string and then convert from one format to another as follows.
If you are sure that your string accurately represents the address in raw or user-friendly format, you can also use the following methods.
However, there is no separate method for parsing external addresses from a string.

Validate addresses

The validity of the address is checked at the time of its parsing. An attempt to parse an invalid address will result in an error. However, you can check separately whether a string is a valid address in raw or user-friendly formats.