The formal charge of HNO3 is 0 because the charge on NO3 is -1 and the charge on H is always +1.
formal charge of an atom in a bond is measured by the number of electrons in it's last energy level.for an example Nitrogen has 5 electrons in it's last energy level.and when calculating the net formal charge, if the number of electrons in the last energy level of any atom increases,as electrons have a negative charge -1 should be added for each increased electron.
as an example in (NO3)^- nitrogen has contributed only 4 electrons to create bonds with oxygen as each bond is created sharing one electron from each atom.so there's a decrease of electrons in the last energy level of nitrogen.so it gets a +1 charge as it lacks one electron.
but if we consider the 3 oxygens around the nitrogen atom,one has 6 electrons which is the correct number of electrons in it's last energy level.but the other two has 7 which gives -1 charges for each atom.
and the total of all these charges equals to -1 which is the net formal charge of NO3.