It's impossible to know for sure, but Hubble revealed that there are at least 100 billion galaxies in the universe. However, this may be a conservative estimation -- other estimates put the total number of galaxies at 2 trillion.
Table of contents
What is a galaxy
Before we start looking for galaxies and counting them, we need to know just what a galaxy is.
Essentially, a galaxy is a huge collection of gas, dust, and billions of stars all tied together by gravity. Although the distances between stars within the same galaxy can be huge, it's important that they're all connected into a single cluster by gravity -- that's what makes it a galaxy. Most galaxies have a supermassive black hole at their center, which helps keep it all together. As the name implies, supermassive black holes are immensely massive black holes -- they have a mass on the order of millions or even billions of solar masses.
There are three types of galaxies: elliptical, spiral, and irregular. The name pretty much describes the overall shape of the galaxy: elliptical galaxies look like an "egg" of light (an ellipse), spiral galaxies extend arms around the central bulge, and irregular galaxies are pretty much everything that's not spiral or elliptical. The Milky Way, our own galaxy, is a spiral galaxy. It seems strange that complex and diverse systems such as galaxies take on such few shapes. Researchers are still not exactly sure why this happens, but these common shapes are likely the product of rotation speed, time and gravity.
Galaxies can also vary greatly in size, which means that some are more easily visible than others. Dwarf galaxies have between 100 million and several billion stars (a very small number compared to the Milky Way's 200-400 billion stars), measuring "only" 300 light-years. Meanwhile, "IC 1101" is the single largest galaxy that has ever been found in the observable universe, spanning a whopping 210,000 light-years across.
Looking for galaxies
So how does one look for galaxies? We can all see (on clear nights) the bright, milk-ish band that lends our galaxy its name. More than 2,000 years ago, the Greek philosopher Democritus (450–370 BCE) proposed that the band might consist of distant stars, a surprisingly insightful idea. Of course, there are many things that Democritus couldn't have known, and it wasn't until 1610 when the Italian astronomer Galileo Galilei used a telescope to study the Milky Way and discovered that it is composed of a huge number of faint and very distant stars.
Fast forwarding to modern times, telescopes have obviously gotten a lot better. But one of the biggest problems for all telescopes is the atmosphere, which contains a lot of light pollution and distortion of electromagnetic radiation. Thankfully, astronomers have by-passed that problem by building space telescopes -- yes, we have telescopes in outer space. The most famous one, although not the first, is the Hubble telescope. Hubble is a vital research tool which has provided an invaluable trove of data. Among others, the landmark Hubble Deep Field, taken in the mid-1990s, gave the first real insight into the universe's galaxy population.
But even with Hubble, counting galaxies is extremely difficult for the simple fact that the universe is, well, very big. Looking in all directions and counting all the galaxies is nigh impossible, so instead, astronomers just focus on a sector of the night sky, count the galaxies there, and extrapolate based on that value. Of course, this can lead to some inaccuracies, but given the sheer size of the universe and the number of galaxies, the inaccuracies are unlikely to be significant.
How many galaxies are there
So, back to the question: how many galaxies are there? The first measurements from the 1990s found that there are 200 billion galaxies in the universe. However, that figure is unlikely to be reliable. Subsequent sensitive observations found that many faint galaxies were not observed the first time. The most recent, and likely the most accurate, survey found that the real number of galaxies is ten times larger: so, in total, there are 2 trillion galaxies in the universe, or 2,000 billion, if you prefer.
In late 2016, Christopher Conselice, Professor of Astrophysics at the University of Nottingham, along with several colleagues, carried out a sort of archaeological cosmology: they calculated the density of galaxies as well as the volume of one small region of space after another. This painstaking research was the culmination of 15 years of research, and it enabled the team to establish how many galaxies we have missed. The team found that, initially, astronomers missed a lot of galaxies because they were faint and very far away.
"We are missing the vast majority of galaxies because they are very faint and far away. The number of galaxies in the universe is a fundamental question in astronomy, and it boggles the mind that over 90% of the galaxies in the cosmos have yet to be studied. Who knows what interesting properties we will find when we study these galaxies with the next generation of telescopes?"
Since many of the very distant galaxies are also faint, it seems that the total number of galaxies is currently decreasing over time. However, the more important takeaway lesson here is that we're still only seeing a very small portion of the universe. Who knows what we might be missing out on. The study also says that the real number of galaxies might be even higher -- up to 10 trillion galaxies.
“It boggles the mind that over 90% of the galaxies in the universe have yet to be studied,” commented Conselice. “Who knows what interesting properties we will find when we observe these galaxies with the next generation of telescopes?” he said in a statement.
Bonus: How many planets are there in the Universe?
If you're still trying to wrap your mind around the number of galaxies, here's another one. Estimating how many planets there are in the universe is much more a ballpark figure, and relies much more on deduction than direct observation. But for the fun of it, let's do some simple math. Let's say there are 2 trillion galaxies out there. The Milky Way is a fairly average galaxy, and it has over 200 billion planets. If we extrapolate based on that, we end up with 400 billion trillion planets in the universe. That's 400,000,000,000,000,000,000,000 planets.
Again, this is definitely an approximation and not scientifically accurate, but it's something to consider when you feel like you're pretty important.