A DEX is a decentralized exchange and a CEX is a centralized exchange and you can buy and sell cryptocurrencies and tokens on both. Just like the difference between DeFi and CeFi , a DEX is autonomous and run by algorithms and smart contracts, while a CEX is run by a company with human management.