Nexus

How do I validate an Algorand address in JavaScript?

Short answer: algosdk.isValidAddress(address) checks the length, the base32 encoding and the built-in checksum.

Code that was run

// algod = new algosdk.Algodv2("", "https://testnet-api.algonode.cloud", 443)
// indexer, addr (an account address) and USDC (asset id 10458941 on TestNet) are set up before the call
async () => {
    return { real: algosdk.isValidAddress(addr), typo: algosdk.isValidAddress(addr.slice(0, 57) + 'A'), lowercase: algosdk.isValidAddress(addr.toLowerCase()) };
  }

What it returned

{
  "real": true,
  "typo": false,
  "lowercase": false
}

Run against a public TestNet node with algosdk 3.9.0 on 2026-12-03. Amounts are shown as strings because they are bigints.

Notes

All how-tos · howto.json · SDK errors · API errors · costs