MasterPVA and WAlg: Mathematica packages for Poisson vertex algebras and classical affine 𝒲-algebras. We give an introduction to the Mathematica packages MasterPVA and MasterPVAmulti used to compute λ-brackets in Poisson vertex algebras, which play an important role in the theory of infinite-dimensional Hamiltonian systems. As an application, we give an introduction to the Mathematica package WAlg aimed to compute the λ-brackets among the generators of classical affine 𝒲-algebras. The use of these packages is shown by providing some explicit examples.