The universe is constantly expanding, and at the moment, researchers believe that the observable universe has stretched 46 billion light-years from its beginning 13.8 billion years ago.
By measuring the cosmic microwave background radiation, researchers are able to quantify how fast the universe is expanding and thus its size, which are both key factors in figuring out how many atoms are in the observable universe. According to Space.com, there are a few assumptions to be made before the calculation can be made; all atoms are contained within stars (they aren't, but the majority of them are), and all of the atoms in the universe are hydrogen atoms (they aren't, but hydrogen atoms account for 90% of the total atoms in the universe).
Calculation: 10^11 to 10^12 galaxies in the observable universe, and each galaxy contains between 10^11 and 10^12 stars. That answer puts the total number of stars in the observable universe to be between 10^22 and 10^24. Now for weight. The average star weighs 2.2x10^32 pounds, which calculates the average mass of the universe to be around 2.2x10^55 pounds. Now that the mass of the universe has been found, we need to figure out how many atoms can fit inside of it. Each gram of matter contains around 10^24 protons, putting the average number of atoms in the observable universe to be 10^82.
Or -
10,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000 atoms.
It should be noted that the above number is not exact and is a rough approximation that contains assumptions to simplify the equation. For a more in-depth explanation for how this number arrived, check out this link here.