Astronomers use a system called magnitudes to determine brightness. If you’ve got a thing for logarithms, you can see the math breakdown here.