This can be determined by comparing their dissociation constants (Kb values). The Kb value represents the base's ability to donate a proton (H+) in an aqueous solution. The higher the Kb value, the stronger the base.
The Kb value of sodium hydroxide is approximately 1.0 x 10^-15, while the Kb value of ammonia is approximately 1.8 x 10^-5. This means that sodium hydroxide dissociates more completely in water, releasing more hydroxide ions (OH-) and resulting in a higher basicity.
In other words, sodium hydroxide is a stronger base because it donates protons more readily and produces a higher concentration of hydroxide ions in a given solution.